Mask class abstract
A Mask describes a geometric shape to show only a portion of a DisplayObject. Pixels inside of the shape are visible and pixels outside of the shape are invisible.
The mask is placed relative to the DisplayObject where it is applied
to. However, you can set the relativeToParent property to true
to
placed the mask relativ to the DisplayObjects parent.
Example:
var rifleScope = Sprite();
rifleScope.mask = Mask.circle(0, 0, 50);
rifleScope.addChild(world);
- Implemented types
Constructors
- Mask()
- Mask.circle(num x, num y, num radius)
-
Create a circular mask.
factory
-
Mask.custom(List<
Point< points)num> > -
Create a custom mask with a polygonal shape defined by
points
.factory - Mask.graphics(Graphics graphics)
-
Create a custom mask defined by a Graphics object.
factory
- Mask.rectangle(num x, num y, num width, num height)
-
Create a rectangular mask.
factory
- Mask.shape(Shape shape)
-
Create a custom mask defined by a Shape object.
factory
Properties
- border ↔ bool
-
getter/setter pairoverride-getter
- borderColor ↔ int
-
getter/setter pairoverride-getter
- borderWidth ↔ int
-
getter/setter pairoverride-getter
- hashCode → int
-
The hash code for this object.
no setterinherited
- relativeToParent ↔ bool
-
Set to
true
to place the Mask relative to the DisplayObjects parent. The default value isfalse
and therefore the mask is placed relative to the DisplayObject where it is applied to.getter/setter pairoverride-getter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transformationMatrix → Matrix
-
You can use the transformationMatrix to change the size,
position, scale, rotation etc. from the Mask.
final
Methods
-
hitTest(
num x, num y) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
renderMask(
RenderState renderState) → void -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited