vzlomvl

Hello. Should the SkeletonGraphic work with RectMask2D?
User avatar
vzlomvl
  • Posts: 56

Pharan

It works fine with UnityEngine.UI.Mask

I think something about premultiply-alpha on the default SkeletonGraphic shader causes it not to work with RectMask2D.
We'll see what shader requirements there are for it to work.
User avatar
Pharan
  • Posts: 5366

kaarloew

Has there been any development regarding the RectMask2D support?

Currently RectMask2D causes ghosting with SkeletonGraphic objects.
You do not have the required permissions to view the files attached to this post.
kaarloew
  • Posts: 13

Harald

Unfortunately RectMask2D support is not yet implemented.
As mentioned above, it currently works with UnityEngine.UI.Mask, which can be used as a workaround for now.

You can subscribe to the ticket if you want to get notified on updates:
[unity] Unity 2017 SpriteMask support · #941

---

RectMask2D support is now implemented.

You can download the latest unitypackage here as usual:
Spine Unity Download
User avatar
Harald

Harri
  • Posts: 327

ericsm

Hey Harald,

How do we make the UI mask work with spine?
ericsm
  • Posts: 5

Harald

You just need to create a parent with a UI mask and then attach the Spine GameObject as a child to this parent. It then automatically masks the SkeletonGraphic accordingly. Please be sure to use the latest unitypackage from the download page above.
User avatar
Harald

Harri
  • Posts: 327

ericsm

Hey Harald,
v3.7 or 3.8?
ericsm
  • Posts: 5

Harald

Both 3.7 and 3.8 support it!
User avatar
Harald

Harri
  • Posts: 327

ericsm

ok i am on 3.7 and it doesn't seem to be working.
i create the UI mask in the canvas and then create the spine gameobject to be a child of this but it doesn't mask.
if i created the skeletongraphic, then masking works.
ericsm
  • Posts: 5

Harald

In Unity you have to consider UI elements with CanvasRenderers that need to be children of a canvas as separate from 'normal' elements with normal Renderer components.

UI Masks like the RectMask2D and the Mask component affect UI Images, not Unity's Sprites.
Normal element's mask such as the SpriteMask component affects Unity's Sprites, but not UI Images.

Same applies when using Spine elements:
UI mask and RectMask2D are affecting SkeletonGraphic only, since it's Spine's UI element.
SpriteMask is affecting SkeletonGraphic and SkeletonMecanim.
User avatar
Harald

Harri
  • Posts: 327


Return to Unity