Sprite class
The Sprite class is a basic display list building block.
It is a display list node that can display graphics and can also contain children.
- Inheritance
- Implementers
Constructors
- Sprite()
Properties
- alpha ↔ num
-
The alpha transparency value of the object specified.
getter/setter pairinherited
- blendMode ↔ BlendMode?
-
A value from the BlendMode class that specifies which blend mode to use.
getter/setter pairinherited
-
bounds
→ Rectangle<
num> -
Returns a rectangle that defines the area of this display object in
this display object's local coordinates.
no setteroverride
-
boundsTransformed
→ Rectangle<
num> -
Returns a rectangle that defines the area of this display object in
this display object's parent coordinates.
no setterinherited
- cache → RenderTextureQuad?
-
This getter gives you access to the underlying RenderTextureQuad if
a cache is applied to this display object. If no cache is applied this
value is ´null´.
no setterinherited
-
children
→ DisplayObjectChildren<
DisplayObject> -
no setterinherited
- displayObjectID → int
-
finalinherited
- doubleClickEnabled ↔ bool
-
Specifies whether the object receives doubleClick events.
getter/setter pairinherited
- dropTarget ↔ DisplayObject?
-
Specifies the display object over which the sprite is being dragged, or on
which the sprite was dropped.
getter/setter pair
-
filters
↔ List<
BitmapFilter> -
The filters currently associated with this display object.
getter/setter pairinherited
- globalTransformationMatrix → Matrix
-
The global 2D transformation matrix of this display object.
no setterinherited
- globalTransformationMatrix3D → Matrix3D
-
The global 3D transformation matrix of this display object.
no setterinherited
- graphics ↔ Graphics
-
Specifies the Graphics object that belongs to this sprite where vector
drawing commands can occur.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ num
-
The height of this display object with the applied transformation.
getter/setter pairinherited
- hitArea ↔ Sprite?
-
Designates another sprite to serve as the hit area for a sprite.
getter/setter pair
- mask ↔ Mask?
-
The calling display object is masked by the specified mask object.
getter/setter pairinherited
- mouseChildren ↔ bool
-
Determines whether or not the children of the object are mouse, or user
input device, enabled.
getter/setter pairinherited
- mouseCursor ↔ String
-
Defines the mouse cursor that is displayed on this interactive object.
getter/setter pairinherited
- mouseEnabled ↔ bool
-
Specifies whether this object receives mouse, or other user input,
messages.
getter/setter pairinherited
-
mousePosition
→ Point<
num> ? -
The position of the mouse relative to the local coordinate system of
the display object.
no setterinherited
- mouseX → num
-
The x-coordinate of the mouse relative to the local coordinate system of
the display object.
no setterinherited
- mouseY → num
-
The y-coordinate of the mouse relative to the local coordinate system of
the display object.
no setterinherited
- name ↔ String
-
The instance name of this display object.
getter/setter pairinherited
- numChildren → int
-
The number of children of this container.
no setterinherited
- off ↔ bool
-
The availability and visibility of the display object.
getter/setter pairinherited
-
onAdded
→ EventStream<
Event> -
Dispatched when a display object is added to the display list.
no setterinherited
-
onAddedToStage
→ EventStream<
Event> -
Dispatched when a display object is added to the on stage display list,
either directly or through the addition of a sub tree in which the display
object is contained.
no setterinherited
-
onDragEnter
→ EventStream<
MouseEvent> -
Dispatched when a HTML element was dragged entering an InteractiveObject
instance.
no setterinherited
-
onDragLeave
→ EventStream<
MouseEvent> -
Dispatched when a HTML element was dragged leaving an InteractiveObject
instance.
no setterinherited
-
onDrop
→ EventStream<
MouseEvent> -
Dispatched when a HTML element was dropped in an InteractiveObject
instance.
no setterinherited
-
onEnterFrame
→ EventStream<
EnterFrameEvent> -
Dispatched when a frame is entered.
no setterinherited
-
onExitFrame
→ EventStream<
ExitFrameEvent> -
Dispatched when a frame is exited. All frame scripts have been run.
no setterinherited
-
onKeyDown
→ EventStream<
KeyboardEvent> -
Dispatched when the user presses a key.
no setterinherited
-
onKeyUp
→ EventStream<
KeyboardEvent> -
Dispatched when the user releases a key.
no setterinherited
-
onMouseClick
→ EventStream<
MouseEvent> -
Dispatched when a user presses and releases the main button of the user's
pointing device over the same InteractiveObject.
no setterinherited
-
onMouseContextMenu
→ EventStream<
MouseEvent> -
Dispatched when a user gesture triggers the context menu associated with
this interactive object.
no setterinherited
-
onMouseDoubleClick
→ EventStream<
MouseEvent> -
Dispatched when a user presses and releases the main button of a pointing
device twice in rapid succession over the same InteractiveObject when that
object's doubleClickEnabled flag is set to true.
no setterinherited
-
onMouseDown
→ EventStream<
MouseEvent> -
Dispatched when a user presses the pointing device button over an
InteractiveObject instance.
no setterinherited
-
onMouseMiddleClick
→ EventStream<
MouseEvent> -
Dispatched when a user presses and releases the middle button of the
user's pointing device over the same InteractiveObject.
no setterinherited
-
onMouseMiddleDown
→ EventStream<
MouseEvent> -
Dispatched when a user presses the middle pointing device button over an
InteractiveObject instance.
no setterinherited
-
onMouseMiddleUp
→ EventStream<
MouseEvent> -
Dispatched when a user releases the pointing device button over an
InteractiveObject instance.
no setterinherited
-
onMouseMove
→ EventStream<
MouseEvent> -
Dispatched when a user moves the pointing device while it is over an
InteractiveObject.
no setterinherited
-
onMouseOut
→ EventStream<
MouseEvent> -
Dispatched when the user moves a pointing device away from an
InteractiveObject instance.
no setterinherited
-
onMouseOver
→ EventStream<
MouseEvent> -
Dispatched when the user moves a pointing device over an
InteractiveObject instance.
no setterinherited
-
onMouseRightClick
→ EventStream<
MouseEvent> -
Dispatched when a user presses and releases the right button of the user's
pointing device over the same InteractiveObject.
no setterinherited
-
onMouseRightDown
→ EventStream<
MouseEvent> -
Dispatched when a user presses the right button over an InteractiveObject
instance.
no setterinherited
-
onMouseRightUp
→ EventStream<
MouseEvent> -
Dispatched when a user releases the right button over an InteractiveObject
instance.
no setterinherited
-
onMouseRollOut
→ EventStream<
MouseEvent> -
Dispatched when the user moves a pointing device away from an
InteractiveObject instance.
no setterinherited
-
onMouseRollOver
→ EventStream<
MouseEvent> -
Dispatched when the user moves a pointing device over an InteractiveObject
instance.
no setterinherited
-
onMouseUp
→ EventStream<
MouseEvent> -
Dispatched when a user releases the pointing device button over an
InteractiveObject instance.
no setterinherited
-
onMouseWheel
→ EventStream<
MouseEvent> -
Dispatched when a mouse wheel is spun over an InteractiveObject instance.
no setterinherited
-
onRemoved
→ EventStream<
Event> -
Dispatched when a display object is about to be removed from the display
list.
no setterinherited
-
onRemovedFromStage
→ EventStream<
Event> -
Dispatched when a display object is about to be removed from the display
list, either directly or through the removal of a sub tree in which the
display object is contained.
no setterinherited
-
onRender
→ EventStream<
RenderEvent> -
Dispatched when the display list is about to be updated and rendered.
no setterinherited
-
onTextInput
→ EventStream<
TextEvent> -
Dispatched when a user enters one or more characters of text.
no setterinherited
-
onTouchBegin
→ EventStream<
TouchEvent> -
Dispatched when the user first contacts a touch-enabled device.
no setterinherited
-
onTouchCancel
→ EventStream<
TouchEvent> -
Dispatched when the touch event is canceled.
no setterinherited
-
onTouchEnd
→ EventStream<
TouchEvent> -
Dispatched when the user removes contact with a touch-enabled device.
no setterinherited
-
onTouchMove
→ EventStream<
TouchEvent> -
Dispatched when the user touches the device, and is continuously
dispatched until the point of contact is removed.
no setterinherited
-
onTouchOut
→ EventStream<
TouchEvent> -
Dispatched when the user moves the point of contact away from
InteractiveObject instance on a touch-enabled device.
no setterinherited
-
onTouchOver
→ EventStream<
TouchEvent> -
Dispatched when the user moves the point of contact over an
InteractiveObject instance on a touch-enabled device.
no setterinherited
-
onTouchRollOut
→ EventStream<
TouchEvent> -
Dispatched when the user moves the point of contact away from an
InteractiveObject instance on a touch-enabled device.
no setterinherited
-
onTouchRollOver
→ EventStream<
TouchEvent> -
Dispatched when the user moves the point of contact over an
InteractiveObject instance on a touch-enabled device.
no setterinherited
-
onTouchTap
→ EventStream<
TouchEvent> -
Dispatched when the user lifts the point of contact over the same
InteractiveObject instance on which the contact was initiated on a
touch-enabled device.
no setterinherited
-
parent
→ DisplayObjectParent<
DisplayObject> ? -
The DisplayObjectContainer object that contains this display object.
no setterinherited
- pivotX ↔ num
-
The x-coordinate of the pivot point of this display object.
getter/setter pairinherited
- pivotY ↔ num
-
The y-coordinate of the pivot point of this display object.
getter/setter pairinherited
- root → DisplayObject
-
The top-most display object in the portion of the display list's tree
structure.
no setterinherited
- rotation ↔ num
-
The rotation of this display object, in radians, from its original
orientation.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleX ↔ num
-
The horizontal scale (percentage) of the object as applied from the
pivot point.
getter/setter pairinherited
- scaleY ↔ num
-
The vertical scale (percentage) of the object as applied from the
pivot point.
getter/setter pairinherited
- skewX ↔ num
-
The horizontal skew of this object.
getter/setter pairinherited
- skewY ↔ num
-
The vertical skew of this object.
getter/setter pairinherited
- stage → Stage?
-
The Stage of this display object.
no setterinherited
- tabChildren ↔ bool
-
Determines whether the children of this container are tab enabled.
getter/setter pairinherited
- tabEnabled ↔ bool
-
Specifies whether this object is in the tab order.
getter/setter pairinherited
- tabIndex ↔ int
-
Specifies the tab ordering of objects.
getter/setter pairinherited
- transformationMatrix → Matrix
-
The transformation matrix of this display object relative to
this display object's parent.
no setterinherited
- useHandCursor ↔ bool
-
getter/setter pairinherited
- userData ↔ dynamic
-
The user-defined data associated with this display object.
getter/setter pairinherited
- visible ↔ bool
-
The visibility and availability of the display object.
getter/setter pairinherited
- width ↔ num
-
The width of this display object with the applied transformation.
getter/setter pairinherited
- x ↔ num
-
The x-coordinate of is display object relative to the
local coordinates of the parent DisplayObjectContainer.
getter/setter pairinherited
- y ↔ num
-
The y-coordinate of this display object relative to the
local coordinates of the parent DisplayObjectContainer.
getter/setter pairinherited
Methods
-
addChild(
DisplayObject child) → void -
Adds a child DisplayObject to this DisplayObjectContainer.
inherited
-
addChildAt(
DisplayObject child, int index) → void -
Adds a child DisplayObject to this DisplayObjectContainer at the
specified
index
position.inherited -
addEventListener<
T extends Event> (String eventType, EventListener< T> eventListener, {bool useCapture = false, int priority = 0}) → StreamSubscription<T> -
Adds an event listener to receive events.
inherited
-
addTo(
DisplayObjectParent< DisplayObject> parent) → void -
Add this display object to the specified
parent
.inherited -
alignPivot(
[HorizontalAlign hAlign = HorizontalAlign.Center, VerticalAlign vAlign = VerticalAlign.Center]) → void -
Aligns the display object's pivot point relative to the current bounds.
inherited
-
applyCache(
num x, num y, num width, num height, {bool debugBorder = false, num pixelRatio = 1.0}) → void -
Draws the specified area of this display object to an internal render
texture and the engine will use this texture to optimize performance.
inherited
-
contains(
DisplayObject child) → bool -
Determines whether the specified DisplayObject is a child of this
DisplayObjectContainer instance or the instance itself.
inherited
-
dispatchEvent(
Event event) → void -
Dispatches the
event
to all listening subscribers.inherited -
dispatchEventRaw(
Event event, EventDispatcher target, EventPhase eventPhase) → void -
Do not use the dispatchEventRaw method unless you want to override the
way how events are dispatched for display list object. Please use
dispatchEvent instead.
inherited
-
getBounds(
DisplayObject targetSpace) → Rectangle< num> -
Returns the bounds of this display object relative to the specified
targetSpace
.inherited -
getChildAt(
int index) → DisplayObject -
Returns the child DisplayObject at the specified
index
.inherited -
getChildByName(
String name) → DisplayObject? -
Returns the child DisplayObject that exists with the specified name.
inherited
-
getChildIndex(
DisplayObject child) → int -
Returns the index position of a child DisplayObject.
inherited
-
getObjectsUnderPoint(
Point< num> point) → List<DisplayObject> -
Returns a list of display objects that lie under the specified
point and are children (or grandchildren, and so on) of this
display object container.
override
-
getTransformationMatrix(
DisplayObject targetSpace) → Matrix -
The 2D transformation matrix relative to the given
targetSpace
.inherited -
getTransformationMatrix3D(
DisplayObject targetSpace) → Matrix3D -
The 3D transformation matrix relative to the given
targetSpace
.inherited -
globalToLocal(
Point< num> globalPoint, [Point<num> ? returnPoint]) → Point<num> -
Converts the point object from the Stage's global coordinates to this
display object's local coordinates.
inherited
-
hasEventListener(
String eventType, {bool useCapture = false}) → bool -
Returns true if the EventDispatcher has event listeners. The
useCapture
paramenter defines if the event listeners should be registered for the capturing event phase or not.inherited -
hitTestInput(
num localX, num localY) → DisplayObject? -
Evaluates this display object to see if the coordinates
localX
andlocalY
are inside this display object.override -
hitTestObject(
DisplayObject other) → bool -
Evaluates this display object to see if it overlaps or intersects with
the bounding box of the
other
display object.inherited -
hitTestPoint(
num x, num y, [bool shapeFlag = false]) → bool -
Evaluates this display object to see if it overlaps or intersects with
the point specified by the
x
andy
parameters.inherited -
localToGlobal(
Point< num> localPoint, [Point<num> ? returnPoint]) → Point<num> -
Converts the point object from this display object's local coordinates
to the Stage global coordinates.
inherited
-
localToParent(
Point< num> localPoint, [Point<num> ? returnPoint]) → Point<num> -
Converts the point object from this display object's local coordinates
to this display object's parent coordinates.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
T extends Event> (String eventType) → EventStream< T> -
Returns an event stream of type
eventType
.inherited -
parentToLocal(
Point< num> parentPoint, [Point<num> ? returnPoint]) → Point<num> -
Converts the point object from this display object's parent coordinates
to this display object's local coordinates.
inherited
-
refreshCache(
) → void -
Refreshes the cached area of this display object.
inherited
-
removeCache(
) → void -
Removes the previously cached area of this display object.
inherited
-
removeChild(
DisplayObject child) → void -
Removes the specified
child
from the child list of this DisplayObjectContainer.inherited -
removeChildAt(
int index) → void -
Removes the child DisplayObject from the specified
index
position in the child list of this DisplayObjectContainer.inherited -
removeChildren(
[int beginIndex = 0, int? endIndex]) → void -
Removes all child DisplayObject instances from the child list of this
DisplayObjectContainer instance.
inherited
-
removeEventListener<
T extends Event> (String eventType, EventListener< T> eventListener, {bool useCapture = false}) → void -
Removes an event listener to stop receiving events.
inherited
-
removeEventListeners(
String eventType) → void -
Removes all event listeners of a given event type.
inherited
-
removeFromParent(
) → void -
Removes this display object from its parent.
inherited
-
render(
RenderState renderState) → void -
Renders this display object with the given
renderState
. The display object is rendered without its filters.override -
renderFiltered(
RenderState renderState) → void -
Renders this display object with the given
renderState
. The display object is rendered with its filters.inherited -
replaceChildAt(
DisplayObject child, int index) → void -
Replaces the child at the specified
index
position with the newchild
. The current child at this position is removed.inherited -
setChildIndex(
DisplayObject child, int index) → void -
Changes the position of an existing
child
in this DisplayObjectContainer to the newindex
.inherited -
setTransform(
num x, num y, [num scaleX = 1, num scaleY = 1, num rotation = 0, num skewX = 0, num skewY = 0, num pivotX = 0, num pivotY = 0]) → void -
Sets transformation properties.
inherited
-
sortChildren(
int compare(DisplayObject a, DisplayObject b)) → void -
Sorts the child list according to the order specified by the
compare
Function.inherited -
startDrag(
[bool lockCenter = false, Rectangle< num> ? bounds]) → void - Lets the user drag this sprite with the mouse or the current touch point.
-
stopDrag(
) → void - Ends the startDrag method.
-
swapChildren(
DisplayObject child1, DisplayObject child2) → void -
Swaps the z-order (front-to-back order) of the two specified child objects.
inherited
-
swapChildrenAt(
int index1, int index2) → void -
Swaps the z-order (front-to-back order) of the child objects at the two
specified index positions in the child list.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited