Ui XML StencilMask - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Ui XML Reference\StencilMask](#ui-xml-referencestencilmask)
* [onlyAffectChildren](#onlyaffectchildren)
|
Ui XML Reference\StencilMask
Shows through part of parent or self Mask
area.
<Mask>
<!-- Button has a child stencil mask that will 'cut through' the masking frame's effect -->
<Button height="200" width="200" xmlns:bind="https://platform.wildsky.dev/xml/ui/bind">
<Frame padding="-20">
<StencilMask id="mask_stencil" backgroundImage="shape_square_32x32" matchParentWidth="true" matchParentHeight="true" />
</Frame>
</Button>
<!-- Frame that actually creates the masking effect -->
<Frame id="mask" active="true" width="9000" height="9000" backgroundImageColor="r: 0, g: 0, b: 0, a: 0.45" />
</Mask>
This xml script produces the following UI:
The stencil mask, given a negative padding, is slightly larger than it's parent button. As the button changes size in response to being clicked on, the stencil mask matches its size and thus the stenciled portion adjusts smoothly.
Shows through part of parent or self Mask area
Value type: boolean
Supports data binding
If true
the stencil mask will only affect children frames. This will make the stencil mask no longer stencil out part of its parent mask. Instead, the stencil will stencil out any covered portions of children frames. This still requires the stencil mask to be placed inside a mask frame, but the mask frame does not need a tinting frame.
<Mask>
<StencilMask id="mask_stencil" height="150" width="150" backgroundImage="shape_square_32x32" onlyAffectChildren="true">
<Button height="200" width="200" xmlns:bind="https://platform.wildsky.dev/xml/ui/bind" />
</StencilMask>
</Mask>
This xml script produces the following UI:
Here the stencil mask cuts a static hole in its child button frame.