-
Notifications
You must be signed in to change notification settings - Fork 1
melon.masks
garryspins edited this page Feb 27, 2026
·
5 revisions
melon.masks

An alternative to stencils that samples a texture
For reference:
The destination is what is being masked, so a multi stage gradient or some other complex stuff
The source is the text, or the thing with alpha
melon

melon.masks.And(kind: melon.masks.KIND_)
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | kind | melon.masks.KIND_ | The kind of mask this is, remember this is not a number enum |

melon.masks.End(kind: melon.masks.KIND_, x: number, y: number, w: number, h: number)
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | kind | melon.masks.KIND_ | The kind of mask this is, remember this is not a number enum |
| 2 | x | number | The x coordinate to render the rectangle at, defaults to 0 |
| 3 | y | number | The y coordinate to render the rectangle at, defaults to 0 |
| 4 | w | number | The width of the rectangle to render |
| 5 | h | number | The height of the rectangle to render |

melon.masks.EndToTexture(tex: ITexture, kind: melon.masks.KIND_)
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | tex | ITexture | |
| 2 | kind | melon.masks.KIND_ | The kind of mask this is, remember this is not a number enum |
Stops the source render and renders everything to the given ITexture

melon.masks.Source()
Stops the destination render
Whats between this and the melon.masks.End call is the source
See the module declaration for an explaination