A base class for filters that utilize separate Objects as a masking object.

Not intended to be used directly.

Masking objects have a number of restrictions on them, see AbstractMask.mask for details.

Variables

mask:Object

The Object contents of which serve as a mask to the filtered Object.

Masking Objects have following limitations: It cannot be a parent of the filtered Object. It should not contain any filters. It should be present in the object tree and precede the Object it masks in the rendering order (rendered before it). Same masking Object cannot be used by multiple mask filters.

maskVisible:Bool

When enabled, masking Object will be visible to the user. Hidden otherwise. ( default : false )

Methods

Inherited Variables

Defined by Filter

@:value(true)autoBounds:Bool = true

When enabled, rendering bounds of the filter will be expanded by Filter.boundsExtend in all directions. Otherwise filter should provide custom bounds through Filter.getBounds call.
Default : true.

@:value(0.)boundsExtend:Float = 0.

Rendering texture boundaries extent. Increases the rendering area by twice the Filter.boundsExtend value.
Automatically applied to object bounds when autoBounds = true or Filter.getBounds is not overridden.
Does not affect boundaries when autoBounds = true and boundsExtend is less than 0.

@:value(true)@:isVarenable:Bool = true

When filter is disabled, attached object will render as usual.

@:value(false)smooth:Bool = false

When enabled, some filters will use bilinear filtering on temporary textures.
Does not affect the majority of filters.

See also:

Inherited Methods

Defined by Filter

draw(ctx:RenderContext, input:Tile):Tile

Renders the filter onto Texture in input Tile.

getBounds(s:Object, bounds:Bounds):Void

Method should populate bounds with rendering boundaries of the Filter for Object s. Initial bounds contents are undefined and it's recommended to either clear them or call s.getBounds(s, bounds). Only used when Filter.autoBounds is false. By default uses given Object bounds and extends them with Filter.boundsExtend. Compared to autoBounds = true, negative boundsExtend is still applied, causing rendering area to shrink.