FREE TRIAL

|

☀
☾
class

ClipMask

Inherits from UnityEngine.MonoBehaviour

Clips the rendered bounds of a UIBlock hierarchy to a rounded-corner rectangle or custom texture. Supports applying a color tint or fade to the UIBlock hierarchy as well.

Remarks

Clipping can be performed via a mask texture or using the rectangular bounds of the UIBlock on this gameobject. If the attached UIBlock is a UIBlock2D, the ClipMask defaults to clipping to the rounded-corner rectangle bounds matching the UIBlock2D's Corner Radius.

Related Articles
Clip Masks

Properties

Clip

Enables or disables clipping. Can be used to make the ClipMask exclusively apply a Tint.

Mask

The texture to use as a mask when Clip == true. Clip shape defaults to a rectangle or a rounded-corner rectangle, depending on the UIBlock attached to this.gameObject, when Mask == null.

Tint

The tint color applied to this UIBlock and its descendants.
The tint is applied multiplicatively: finalRenderedColor *= Tint.
Adjust Tint.a (alpha) to apply a fade. Set Tint to Color.white if no tint is desired.

UIBlock

The UIBlock on this.gameObject.

Note

While nesting ClipMasks is supported, content will only clip to the first ClipMask in their hierarchy and ignore any ClipMasks above that.

☀
☾
In This Article
Legal EmailContact Github
Copyright © 2022 Supernova Technologies, LLC