| Package | org.wak.scene |
| Class | public class Scene |
| Inheritance | Scene flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
| bookMode : Boolean | Scene | ||
| Property | Defined by | ||
|---|---|---|---|
| mActiveWalkBehind : WalkBehindArea = null | Scene | ||
| mAmbientSound : Sound = null | Scene | ||
| mAmbientSoundChan : SoundChannel = null | Scene | ||
| mBookModeEnabled : Boolean = false | Scene | ||
| mCharactersOnScene : Array = null | Scene | ||
| mCurrentSelectedInteractable : ISceneInteractable = null | Scene | ||
| mDrawLayer : Sprite = null | Scene | ||
| mOnPlayerWalkCompleteFunc : Function = null | Scene | ||
| mResMngr : Class = null | Scene | ||
| mSceneId : String = "" | Scene | ||
| mStageHeight : Number = 0 [static]
| Scene | ||
| mStageWidth : Number = 0 [static]
| Scene | ||
| Method | Defined by | ||
|---|---|---|---|
|
Scene(pDef:ISceneDefinition)
Constructor
| Scene | ||
|
addInteractableItem(pNewItem:ISceneInteractable):void
Add a new Scene Item to the Scene
| Scene | ||
|
DetectGateSpotsCollision():void
| Scene | ||
|
GetGatespot(pGatespotId:String):GateSpot
Get a scene GateSpot by destination.
| Scene | ||
|
GetSceneItem(pItemId:String):ISceneInteractable
Get an Scene item from the scene
| Scene | ||
|
mapToScreen(p:IntPoint):Point
Return the center position of a tile in pixels
| Scene | ||
|
MoveCharacterTo(pCharId:String, pX:Number, pY:Number, pOnCompleteFunc:Function = null):void
Moves the Scene's PlayerDisplay of the character in pCharId to the pX, pY coordinates by walking.
| Scene | ||
|
OnClick(event:MouseEvent):void
Handle click, start solving
| Scene | ||
|
OnEnterScene():void
Method called when the players enters the Scene.
| Scene | ||
|
OnExitScene():void
Method called when the players exits the Scene.
| Scene | ||
|
RemoveInteractable(pItem:ISceneInteractable):void
Removes an ISceneInteractable from the scene
| Scene | ||
|
SetPlayerDisplayFromScene(pFromSceneId:String):void
If there are two scenes connected by a GateSpots.
| Scene | ||
|
SetWalkTiles(pTilesArr:Array, pWalkable:Boolean):void
| Scene | ||
|
Update(event:Event):void
Main Loop Update method.
| Scene | ||
| Method | Defined by | ||
|---|---|---|---|
|
Calculate the angle between two differents IntPoints.
| Scene | ||
|
capturingHandler(e:Event):void
| Scene | ||
|
CleanHeroRoute(pTileRoute:Array):Array
Clean the AStar results to have a continuous walk.
| Scene | ||
|
createCursor(size:Number, col:uint):Shape
Make a rounded to mark a position.
| Scene | ||
|
Draw a line from a to b
| Scene | ||
|
Find a walkable goal when the clicked tile is not walkable.
| Scene | ||
|
Init():void
Initialize internal stuff to set the Scene to run.
| Scene | ||
|
InitScroll():void
| Scene | ||
|
mapToScreenCoord(pTileCoord:int):Number
Return the center position of a tile in pixels
works for both coordinates x or y.
| Scene | ||
|
OnAddedToStage(event:Event):void
Listener of the ADDED_TO_STAGE .
| Scene | ||
|
OnPlayerWalkCompleted():void
| Scene | ||
|
OnRemovedFromStage(event:Event):void
Listener of the REMOVED_FROM_STAGE .
| Scene | ||
|
screenToMap(pX:Number, pY:Number):IntPoint
On which tile is a point on the screen?
| Scene | ||
|
SetWalkBlockedTiles(pTMap:TileMap, pWalkBlockArray:Array, pWalkable:Boolean = false):void
Place in the tile map the walk blocked or unblocked tiles received in pWalkBlockArray.
| Scene | ||
|
updateCursors():void
Place the cursors on their positions.
| Scene | ||
|
UpdateDepth():void
Update the Depth position of the Depth managed objects.
| Scene | ||
|
UpdatePerspective():void
Updates the PlayerRenderer Size accordly to its position in the Scene.
| Scene | ||
|
UpdateScroll():void
Updates the scroll of the Scene accordly to the player's position.
| Scene | ||
|
WalkDestinationReached():void
| Scene | ||
| bookMode | property |
bookMode:Boolean [read-write]Implementation
public function get bookMode():Boolean
public function set bookMode(value:Boolean):void
| mActiveWalkBehind | property |
protected var mActiveWalkBehind:WalkBehindArea = null
| mAmbientSound | property |
protected var mAmbientSound:Sound = null
| mAmbientSoundChan | property |
protected var mAmbientSoundChan:SoundChannel = null
| mBookModeEnabled | property |
protected var mBookModeEnabled:Boolean = false
| mCharactersOnScene | property |
protected var mCharactersOnScene:Array = null
| mCurrentSelectedInteractable | property |
protected var mCurrentSelectedInteractable:ISceneInteractable = null
| mDrawLayer | property |
protected var mDrawLayer:Sprite = null
| mOnPlayerWalkCompleteFunc | property |
protected var mOnPlayerWalkCompleteFunc:Function = null
| mResMngr | property |
protected var mResMngr:Class = null
| mSceneId | property |
protected var mSceneId:String = ""
| mStageHeight | property |
protected static var mStageHeight:Number = 0
| mStageWidth | property |
protected static var mStageWidth:Number = 0
| Scene | () | constructor |
public function Scene(pDef:ISceneDefinition)Constructor
ParameterspDef:ISceneDefinition — wich defines the main Scene's data.
|
| addInteractableItem | () | method |
public function addInteractableItem(pNewItem:ISceneInteractable):voidAdd a new Scene Item to the Scene
ParameterspNewItem:ISceneInteractable — the new LItem to add in the Scene.
|
| AngleInTwoIntPoints | () | method |
protected function AngleInTwoIntPoints(pPointA:IntPoint, pPointB:IntPoint):NumberCalculate the angle between two differents IntPoints.
ParameterspPointA:IntPoint |
|
pPointB:IntPoint |
Number |
| capturingHandler | () | method |
protected function capturingHandler(e:Event):voidParameters
e:Event |
| CleanHeroRoute | () | method |
protected function CleanHeroRoute(pTileRoute:Array):ArrayClean the AStar results to have a continuous walk.
ParameterspTileRoute:Array |
Array |
| createCursor | () | method |
protected function createCursor(size:Number, col:uint):ShapeMake a rounded to mark a position.
Parameterssize:Number — size of the square marker.
|
|
col:uint — color of the cursor.
|
Shape |
| DetectGateSpotsCollision | () | method |
public function DetectGateSpotsCollision():void
| drawLine | () | method |
protected function drawLine(a:IntPoint, b:IntPoint, col:uint, width:Number = 1):voidDraw a line from a to b
Parametersa:IntPoint |
|
b:IntPoint |
|
col:uint |
|
width:Number (default = 1) |
| FindWalkableGoal | () | method |
protected function FindWalkableGoal(pStart:IntPoint, pGoal:IntPoint):voidFind a walkable goal when the clicked tile is not walkable.
ParameterspStart:IntPoint |
|
pGoal:IntPoint |
| GetGatespot | () | method |
public function GetGatespot(pGatespotId:String):GateSpotGet a scene GateSpot by destination.
ParameterspGatespotId:String — gatespot id.
|
GateSpot —
GateSpot.
|
| GetSceneItem | () | method |
public function GetSceneItem(pItemId:String):ISceneInteractableGet an Scene item from the scene
ParameterspItemId:String — id of the item
|
ISceneInteractable —
ISceneInteractable if the item is on the scene.
|
| Init | () | method |
protected function Init():voidInitialize internal stuff to set the Scene to run.
| InitScroll | () | method |
protected function InitScroll():void
| mapToScreen | () | method |
public function mapToScreen(p:IntPoint):PointReturn the center position of a tile in pixels
Parametersp:IntPoint |
Point |
| mapToScreenCoord | () | method |
protected function mapToScreenCoord(pTileCoord:int):NumberReturn the center position of a tile in pixels works for both coordinates x or y.
ParameterspTileCoord:int |
Number |
| MoveCharacterTo | () | method |
public function MoveCharacterTo(pCharId:String, pX:Number, pY:Number, pOnCompleteFunc:Function = null):voidMoves the Scene's PlayerDisplay of the character in pCharId to the pX, pY coordinates by walking.
ParameterspCharId:String — horizontal coordinate on the scene
|
|
pX:Number — vertical coordinate on the scene.
|
|
pY:Number |
|
pOnCompleteFunc:Function (default = null) |
| OnAddedToStage | () | method |
protected function OnAddedToStage(event:Event):voidListener of the ADDED_TO_STAGE .
Parametersevent:Event |
| OnClick | () | method |
public function OnClick(event:MouseEvent):voidHandle click, start solving
Parametersevent:MouseEvent |
| OnEnterScene | () | method |
public function OnEnterScene():voidMethod called when the players enters the Scene.
| OnExitScene | () | method |
public function OnExitScene():voidMethod called when the players exits the Scene.
| OnPlayerWalkCompleted | () | method |
protected function OnPlayerWalkCompleted():void
| OnRemovedFromStage | () | method |
protected function OnRemovedFromStage(event:Event):voidListener of the REMOVED_FROM_STAGE .
Parametersevent:Event |
| RemoveInteractable | () | method |
public function RemoveInteractable(pItem:ISceneInteractable):voidRemoves an ISceneInteractable from the scene
ParameterspItem:ISceneInteractable — ISceneInteractable to remove.
|
| screenToMap | () | method |
protected function screenToMap(pX:Number, pY:Number):IntPointOn which tile is a point on the screen?
ParameterspX:Number |
|
pY:Number |
IntPoint |
| SetPlayerDisplayFromScene | () | method |
public function SetPlayerDisplayFromScene(pFromSceneId:String):voidIf there are two scenes connected by a GateSpots. If the player came from scene A the player display will be placed near the GateSpot which jumps back to the scene A. If there is no corresponding GateSpot no change of coordinates will be made.
ParameterspFromSceneId:String — Scene id where the player came from.
|
| SetWalkBlockedTiles | () | method |
protected function SetWalkBlockedTiles(pTMap:TileMap, pWalkBlockArray:Array, pWalkable:Boolean = false):voidPlace in the tile map the walk blocked or unblocked tiles received in pWalkBlockArray.
ParameterspTMap:TileMap — Tilemap to set the non walkable tiles.
|
|
pWalkBlockArray:Array — list of IntPoint with the tiles to set non walkable.
|
|
pWalkable:Boolean (default = false) |
| SetWalkTiles | () | method |
public function SetWalkTiles(pTilesArr:Array, pWalkable:Boolean):voidParameters
pTilesArr:Array |
|
pWalkable:Boolean |
| Update | () | method |
public function Update(event:Event):voidMain Loop Update method.
Parametersevent:Event |
| updateCursors | () | method |
protected function updateCursors():voidPlace the cursors on their positions.
| UpdateDepth | () | method |
protected function UpdateDepth():voidUpdate the Depth position of the Depth managed objects.
| UpdatePerspective | () | method |
protected function UpdatePerspective():voidUpdates the PlayerRenderer Size accordly to its position in the Scene.
| UpdateScroll | () | method |
protected function UpdateScroll():voidUpdates the scroll of the Scene accordly to the player's position.
| WalkDestinationReached | () | method |
protected function WalkDestinationReached():void