abstract class DisplayObject

Package :

(default package)

Extends :

Known subclasses :

Description :

Represents any object that can be added to the stage and drawn using canvas.

See also :

Attributes :

NameDescription
alphaThe object's transparency.
areaThe actual occupied area by the graphics object.
heightThe object's height.
parentThe object's parent container.
rotationThe object's rotation.
scaleXThe x scale.
scaleYThe y scale.
stageThe objet's containing Stage.
staticSpecifies whether the object will often change. If set to true, the objet will use a cache and should be faster (use only for complex objects).
visibleSpecifies whether the objet will be displayed.
widthThe object's width.
xThe x coordinate.
yThe y coordinate.

Methods :

abstract new()

Creates a new abstract DisplayObject object.

public actualPosition()

Getting the element's actual position on the stage.

Returns :

The point representing the object's position on the stage.

protected addedToStage()

Called when added to a stage (or when the object's parent was added).

protected canBeCached()

Checking if everything has been loaded in the Graphics object. This is useful to wait until all images are loaded before caching content.

Returns :

true if the cache can be created.

public count()

Returns :

The size of the current object.

createCache()

Caching the object's display. An object should be cached only when using static performance-consuming graphics. If not, using the cache will only make it slower.

protected doEnterFrame()

Dispatching ENTER_FRAME event.

protected draw(context)

Uses the Graphics object to draw on the specified context.

Parameters :

protected extrems()

Getting the object's extrem points, in order to calculate size.

Returns :

An object containing the four extrems (minX,minY,maxX and maxY).

public graphicsInstructions()

Gets the number of graphics instructions used for this object.

Returns :

The number of instructions which are required to draw the object.

protected outDatedSize()

Setting the size to outdated (when hierarchy changes, for instance). Object's parent is therefore also outdated.

protected recalculateSize()

Complete recalculation of the object's size.

protected removedFromStage()

Called when removed from the stage (or when the parent was removed).

public trace()

Tracing the object's structure.

public transformMatrix()

Getting the transformation matrix. This is useful to get an element's actual position. This is quite time consuming, so it shouldn't be used too many times.

Returns :

The object's transofmr Matrix.