extended by AbstractMask, Blur, ColorMatrix, Displacement, Group, Nothing, Outline, Shader
The base filter class, you can extend it in order to define your own filters, although ShaderFilter will be the most straightforward way to define simple custom filter.
Keep in mind that filters use internal Object resolution to render its content, hence scaling of the filtered object would not increase the rendering resolution.
For example, 20x20px
scale = 2 will render onto 20x20 filter texture if filter is attached to it directly,
but if filter is attached to the parent of that bitmap, filter will render 40x40 texture.
Another thing to be aware of, is that
Scene.scaleMode does not affect filter resolution either,
and upscaling contents with
scaleMode would not upscale the resolution of filtered content.
For optimization purposes, rendering boundaries are clipped by scene viewport and nothing will be rendered offscreen.
autoBounds:Bool = true
boundsExtend:Float = 0.
enable:Bool = true
When filter is disabled, attached object will render as usual.
Sent when filter is bound to an Object
If Object was not yet allocated, method will be called when it's added to allocated Scene.
Method should populate
bounds with rendering boundaries of the Filter for Object
bounds contents are undefined and it's recommended to either clear them or call
Only used when
By default uses given Object bounds and extends them with
autoBounds = true, negative
boundsExtend is still applied, causing rendering area to shrink.