Clip Masks
Clipping/Masking in Nova is accomplished using the ClipMask component, which clips content performantly without using the stencil buffer. It supports the following features:
Clip to Rounded-Corner Rectangle
If the UIBlock on the GameObject with the ClipMask is a UIBlock2D
, the clip rect will round using the corner radius of the UIBlock2D
.
Clip to Texture
To clip using a texture mask, simply set mask to the desired texture. Mathematically speaking, the final rendered color is calculated as:
finalColor = blockColor * clipMaskTextureColor;