Ui XML StencilMask - BLKTower/TestWiki GitHub Wiki

Table of Contents

Ui XML Reference\StencilMask

Shows through part of parent or self Mask area.

Example Usage

<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: Stencil Mask

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.

Related Trigger Function(s):

Related UI XML Properties:

Shows through part of parent or self Mask area

onlyAffectChildren

Value type: boolean

Supports data binding

Description

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.

Example Usage

<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: Stencil Mask Child Only

Here the stencil mask cuts a static hole in its child button frame.

Related Trigger Function(s):

⚠️ **GitHub.com Fallback** ⚠️