The CursorManager, manage the cursor, hide system mouse cursor, show custom cursor,
etc.
protected var currentCursor:DisplayObject = null
protected var cursorHolder:DisplayObjectContainer = null
protected var root:DisplayObjectContainer = null
public function CursorManager(cursorRoot:DisplayObjectContainer)
Create a CursorManage
Parameters
| cursorRoot:DisplayObjectContainer — the container to hold the cursors
|
See also
protected function getCursorContainerRoot():DisplayObjectContainer
Returns
public static function getManager(stage:Stage = null):CursorManager
Returns the default cursor manager for specified stage.
Generally, you should call this method to get cursor manager,
it will create one manager for each stage.
Parameters
| stage:Stage (default = null) — the stage, if pass null, the inital Stage of AsWingManager.getStage()
will be used.
|
Returns
public function hideCustomCursor(cursor:DisplayObject):void
Hides the custom cursor which is showing and show the system cursor.
Parameters
| cursor:DisplayObject — the showing cursor, if it is not the showing cursor, nothing
will happen
|
public function setCursor(trigger:InteractiveObject, cursor:DisplayObject):void
Sets the cursor when mouse on the specified trigger. null to remove cursor for that trigger.
Parameters
| trigger:InteractiveObject — where the cursor will shown when the mouse on the trigger
|
| |
| cursor:DisplayObject — the cursor object, if cursor is null, the trigger's current cursor will be removed
|
protected function setCursorContainerRoot(theRoot:DisplayObjectContainer):void
Sets the container to hold the cursors(in fact it will hold the cursor's parent--a sprite).
By default(if you have not set one), it is the stage if AsWingManager is inited.
Parameters
| theRoot:DisplayObjectContainer — the container to hold the cursors.
|
public function showCustomCursor(cursor:DisplayObject, hideSystemCursor:Boolean = true):void
Shows your display object as the cursor and/or not hide the system cursor.
If current another custom cursor is showing, the current one will be removed
and then the new one is shown.
Parameters
| cursor:DisplayObject — the display object to be add to the cursor container to be the cursor
|
| |
| hideSystemCursor:Boolean (default = true) — whether or not hide the system cursor when custom cursor shows.
|