Class Stage
Extends
DisplayObjectContainer.
The Stage represents the entire area of canvas where display contents are shown. The Stage is the root of all display objects.
Constructor Attributes | Constructor Name and Description |
---|---|
Stage()
Constructor.
|
Field Attributes | Field Name and Description |
---|---|
Refer to the working canvas.
|
|
Refer to the working context.
|
|
Refer to current dragging object.
|
|
Refer to current mouse target if set traceMouseTarget to true.
|
|
The x coordinate of mouse position on stage.
|
|
The y coordinate of mouse position on stage.
|
|
Determine whether trace mouse target.
|
- Fields borrowed from class DisplayObjectContainer:
- children, mouseChildren
- Fields borrowed from class DisplayObject:
- alpha, height, id, mouseEnabled, name, parent, regX, regY, rotation, scaleX, scaleY, stage, useHandCursor, visible, width, x, y
Method Attributes | Method Name and Description |
---|---|
clear(x, y, width, height)
Clears the canvas by specific rectangle, if not set, clear the whole canvas
|
|
Gets the frame rate of the stage.
|
|
Gets whether the stage stops rendering.
|
|
The current height of the Stage.
|
|
The current width of the Stage.
|
|
setCursor(cursor)
Sets the mouse cursor type of the stage.
|
|
setFrameRate(frameRate)
Sets the frame rate of the stage.
|
|
setPaused(pause, pauseInNextFrame)
Determines whether start or stop rendering of the stage.
|
|
startDrag(target, bounds)
Lets the user drag the specified display object.
|
|
stopDrag()
Ends the startDrag() method.
|
- Methods borrowed from class DisplayObjectContainer:
- addChild, addChildAt, contains, getChildAt, getChildByName, getChildIndex, getNumChildren, getObjectUnderPoint, removeAllChildren, removeChild, removeChildAt, removeChildByName, setChildIndex
- Methods borrowed from class DisplayObject:
- getCurrentHeight, getCurrentWidth, getRect, getStage, globalToLocal, hitTestObject, hitTestPoint, localToGlobal, localToTarget, onMouseEvent, render, toString
- Methods borrowed from class EventDispatcher:
- addEventListener, dispatchEvent, hasEventListener, removeAllEventListeners, removeEventListener, removeEventListenerByType
Field Detail
canvas
Refer to the working canvas.
context
Refer to the working context.
dragTarget
Refer to current dragging object.
mouseTarget
Refer to current mouse target if set traceMouseTarget to true.
mouseX
The x coordinate of mouse position on stage.
mouseY
The y coordinate of mouse position on stage.
traceMouseTarget
Determine whether trace mouse target.
Method Detail
clear(x, y, width, height)
Clears the canvas by specific rectangle, if not set, clear the whole canvas
- Parameters:
- x
- y
- width
- height
getFrameRate()
Gets the frame rate of the stage.
getPaused()
Gets whether the stage stops rendering.
getStageHeight()
The current height of the Stage.
getStageWidth()
The current width of the Stage.
setCursor(cursor)
Sets the mouse cursor type of the stage.
- Parameters:
- cursor
setFrameRate(frameRate)
Sets the frame rate of the stage.
- Parameters:
- frameRate
setPaused(pause, pauseInNextFrame)
Determines whether start or stop rendering of the stage.
- Parameters:
- pause
- pauseInNextFrame
startDrag(target, bounds)
Lets the user drag the specified display object.
- Parameters:
- target
- bounds
stopDrag()
Ends the startDrag() method.