OutlineFilter class

Creates a "border" around the target object. A filter that outlines a display object by applying a stroke around it.

The color property specifies the color of the stroke, and the width property specifies its thickness.

The adjustToScale property controls whether the stroke width is scaled based on the object's scale or remains fixed. If adjustToScale is set to true, the stroke width adapts to the "world" scale of the object.

This filter is not supported on web canvases.

Inheritance

Constructors

OutlineFilter({Color color = kColorBlack, double width = 1, bool adjustToScale = false})
Creates a new OutlineFilter with the specified properties.

Properties

adjustToScale bool
Whether or not to adjust the outline's width to match the scale of the owner.
getter/setter pair
color Color
The color of the outline.
getter/setter pair
currentObject GDisplayObject?
The currentObject property holds a reference to the display object that the filter is applied to. OutlineFilter uses this to adjust the filter size to the current object scale.
getter/setter pairinherited
dirty bool
The dirty property is used to determine if the filter needs to be rebuilt.
getter/setter pairinherited
filterRect GRect
Returns the filter rectangle bounds.
no setter
hashCode int
The hash code for this object.
no setterinherited
hideObject bool
Whether to hide the content behind the filter.
getter/setter pairinherited
isValid bool
(Internal usage) Determines whether the filter is valid and can be applied.
no setteroverride
layerBounds GRect?
The layerBounds property holds the bounds of the display object.
getter/setter pairinherited
paint Paint
The paint object used to apply the painting function.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double
The width of the outline, in logical pixels.
getter/setter pair

Methods

buildFilter() → void
(Internal usage) Builds the filter and sets its properties.
override
expandBounds(GRect layerBounds, GRect outputBounds) → void
(Internal usage) Expands the bounds of the filtered object to include the outline.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(Canvas canvas, Function applyPaint, [int processCount = 1]) → void
(Internal usage) Applies the filter to the given canvas.
override
resolvePaint(Paint paint) → void
Applies the filter effect to the specified paint object.
inherited
toString() String
A string representation of this object.
inherited
update() → void
The update method is called to check if the filter needs to be rebuilt. If the dirty property is true and the isValid property is also true, then the buildFilter method is called to rebuild the filter.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited