- 編集済み
SkeletonGraphic and RectMask2D
Hello. Should the SkeletonGraphic work with RectMask2D?
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.
Has there been any development regarding the RectMask2D support?
Currently RectMask2D causes ghosting with SkeletonGraphic objects.
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
Hey Harald,
How do we make the UI mask work with spine?
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.
Hey Harald,
v3.7 or 3.8?
Both 3.7 and 3.8 support it!
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.
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.