Skip to content

melon.masks

garryspins edited this page Feb 27, 2026 · 5 revisions

melon.masks


client link
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

Functions

melon.masks.And

client link
melon.masks.And(kind: melon.masks.KIND_)

Argument and Return information

Arguments

# Name Type Description
1 kind melon.masks.KIND_ The kind of mask this is, remember this is not a number enum
Renders the given kind of mask and continues the mask render This can be used to layer masks This must be called post melon.masks.Source You still need to call End

melon.masks.End

client link
melon.masks.End(kind: melon.masks.KIND_, x: number, y: number, w: number, h: number)

Argument and Return information

Arguments

# 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
Stops the source render and renders everything finally See the module declaration for an explaination

melon.masks.EndToTexture

client link
melon.masks.EndToTexture(tex: ITexture, kind: melon.masks.KIND_)

Argument and Return information

Arguments

# 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

client link
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

melon.masks.Start

client link
melon.masks.Start()
Starts the mask destination render Whats between this and the melon.masks.Source call is the destination See the module declaration for an explaination

Enumerations

melon.masks.KIND_

client link

Determines the type of mask were rendering

Name Description
KIND_CUT Cuts the source out of the destination
KIND_STAMP Cuts the destination out of the source

Clone this wiki locally