Package | stencyl.api.engine |
Class | public class GameState |
Inheritance | GameState FlxState flash.display.Sprite |
Property | Defined By | ||
---|---|---|---|
actors : Array | GameState | ||
actorsOfType : Array | GameState | ||
actorsOnScreen : Array | GameState | ||
actorsToCreateInNextScene : Array | GameState | ||
actorsToRender : Array | GameState | ||
allActors : Array | GameState | ||
behaviors : BehaviorManager | GameState | ||
bgColor : uint [static]
This static variable indicates the "clear color"
or default background color of the game. | FlxState | ||
bottom : int | GameState | ||
bottomLayer : int | GameState | ||
camera : Actor | GameState | ||
debug : Boolean = false [static] | GameState | ||
debugDraw : Boolean = false [static] | GameState | ||
debugDrawer : b2DebugDraw [static] | GameState | ||
defaultGroup : FlxGroup
Internal group used to organize and display objects you add to this state. | FlxState | ||
dynamicTiles : Dictionary | GameState | ||
enterTimer : Number = 0 | GameState | ||
g : Graphics | GameState | ||
gameAttributes : Array | GameState | ||
gameID : int [static] | GameState | ||
gameName : String [static] | GameState | ||
groups : Array | GameState | ||
hudActors : HashSet | GameState | ||
initSceneID : int = -1 [static] | GameState | ||
isLocalGame : Boolean | GameState | ||
ITERATIONS : int = 3 [static] | GameState | ||
joints : Array | GameState | ||
layerOrders : Array | GameState | ||
layers : Array | GameState | ||
layersToDraw : Array | GameState | ||
leaveTimer : Number = 0 | GameState | ||
left : int | GameState | ||
middleLayer : int | GameState | ||
nextID : uint | GameState | ||
numLeft : int = 0 [static] | GameState | ||
parallax : ParallaxArea | GameState | ||
password : String = Offline [static] | GameState | ||
physicsScale : Number = 10.0 [static] | GameState | ||
playfield : Area | GameState | ||
PSCALE : Number = 1.0 [static] | GameState | ||
recycledActorsOfType : Array | GameState | ||
regions : Array | GameState | ||
right : int | GameState | ||
rootPanel : Panel | GameState | ||
rootPanelLayer : int = -1 | GameState | ||
scene : Scene | GameState | ||
screen : FlxSprite [static]
This static variable holds the screen buffer,
so you can draw to it directly if you want. | FlxState | ||
startCounter : int = 3000 | GameState | ||
started : Boolean = false | GameState | ||
STEP_SIZE : Number [static] | GameState | ||
STEP_SIZE_MS : Number [static] | GameState | ||
terrainRegions : Array | GameState | ||
tileLayers : Array | GameState | ||
top : int | GameState | ||
topLayer : int | GameState | ||
username : String = Offline [static] | GameState | ||
world : b2World | GameState |
Method | Defined By | ||
---|---|---|---|
Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the game loop. | FlxState | ||
addAlwaysOnActor(a:Actor):void | GameState | ||
addHUDActor(a:Actor):void | GameState | ||
GameState | |||
GameState | |||
GameState | |||
addTerrainRegion(r:TerrainRegion):void | GameState | ||
begin():void | GameState | ||
bringForward(a:Actor):void | GameState | ||
bringRootPanelForward():void | GameState | ||
bringRootPanelToFront():void | GameState | ||
bringToFront(a:Actor):void | GameState | ||
cacheActors():Array | GameState | ||
cameraFollow(actor:Actor, lockX:Boolean = true, lockY:Boolean = true):void | GameState | ||
cleanup():void | GameState | ||
collide():void
This function collides defaultGroup against defaultGroup
(basically everything you added to this state). | FlxState | ||
create():void [override] | GameState | ||
GameState | |||
createActorInNextScene(type:ActorType, x:int, y:int, layer:int):void | GameState | ||
GameState | |||
createBoxRegion(x:Number, y:Number, w:Number, h:Number):Region | GameState | ||
createBoxTerrainRegion(x:Number, y:Number, w:Number, h:Number, groupID:int = 1):TerrainRegion | GameState | ||
createCircularRegion(x:Number, y:Number, r:Number):Region | GameState | ||
createCircularTerrainRegion(x:Number, y:Number, r:Number, groupID:int = 1):TerrainRegion | GameState | ||
createCustomStickJoint(one:b2Body, x1:Number, y1:Number, two:b2Body, x2:Number, y2:Number):b2DistanceJoint | GameState | ||
createDynamicTile(shape:b2Shape, x:Number, y:Number, layerID:Number, width:Number, height:Number):void | GameState | ||
createHingeJoint(one:b2Body, two:b2Body = null, pt:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, torque:Number = 0, speed:Number = 0):b2RevoluteJoint | GameState | ||
createSlidingJoint(one:b2Body, two:b2Body = null, dir:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, force:Number = 0, speed:Number = 0):b2LineJoint | GameState | ||
createStickJoint(one:b2Body, two:b2Body, jointID:int = -1, collide:Boolean = false, damping:Number = 0, frequencyHz:Number = 0):b2DistanceJoint | GameState | ||
destroy():void
Override this function to handle any deleting or "shutdown" type operations you
might need (such as removing traditional Flash children like Sprite objects). | FlxState | ||
destroyJoint(j:b2Joint):void | GameState | ||
disableGlobalSleeping():void | GameState | ||
enableGlobalSleeping():void | GameState | ||
enterScene():void | GameState | ||
GameState | |||
GameState | |||
getBottomLayer():int | GameState | ||
getGameAttribute(name:String):* | GameState | ||
GameState | |||
getIDFromLayerOrder(layerOrder:int):int | GameState | ||
GameState | |||
getMiddleLayer():int | GameState | ||
getOrderForLayerID(layerID:int):int | GameState | ||
getPhysicalHeight():Number | GameState | ||
getPhysicalWidth():Number | GameState | ||
GameState | |||
GameState | |||
GameState | |||
getRegions(ID:int):Array | GameState | ||
getTerrainRegion(ID:int):TerrainRegion | GameState | ||
getTerrainRegions(ID:int):Array | GameState | ||
getTopLayer():int | GameState | ||
getValue(behaviorName:String, attributeName:String):Object | GameState | ||
initBehaviors(manager:BehaviorManager, behaviorValues:Array, parent:Object, game:GameState, initialize:Boolean):void [static] | GameState | ||
initPhysics():void | GameState | ||
innerUpdate():void | GameState | ||
GameState | |||
isTransitioning():Boolean | GameState | ||
leaveScene():void | GameState | ||
loadActors():void | GameState | ||
loadCamera():void | GameState | ||
loadScene(sceneID:Number):void | GameState | ||
loadTerrain():void | GameState | ||
moveToLayerOrder(a:Actor, layerOrder:int):void | GameState | ||
nextJointID():int | GameState | ||
nextRegionID():int | GameState | ||
nextTerrainRegionID():int | GameState | ||
postProcess():void
Override this function to do special pre-processing FX like light bloom. | FlxState | ||
preProcess():void
Override this function to do special pre-processing FX like motion blur. | FlxState | ||
recycleActor(a:Actor):void | GameState | ||
removeActor(a:Actor):void | GameState | ||
removeHUDActor(a:Actor):void | GameState | ||
removeRegion(ID:int):void | GameState | ||
removeTerrainRegion(ID:int):void | GameState | ||
render():void [override] | GameState | ||
say(behaviorName:String, msg:String, args:Array):Object | GameState | ||
sendBackward(a:Actor):void | GameState | ||
sendRootPanelBack():void | GameState | ||
sendRootPanelToBack():void | GameState | ||
sendToBack(a:Actor):void | GameState | ||
setGameAttribute(name:String, value:*):void | GameState | ||
setOffscreenTolerance(top:int, left:int, bottom:int, right:int):void | GameState | ||
setValue(behaviorName:String, attributeName:String, value:Object):void | GameState | ||
shout(msg:String, args:Array):Object | GameState | ||
GameState | |||
toPhysicalUnits(value:Number):Number [static] | GameState | ||
toPixelUnits(value:Number):Number [static] | GameState | ||
update():void [override] | GameState | ||
[static] | GameState | ||
[static] | GameState |
Constant | Defined By | ||
---|---|---|---|
MAX_ELAPSED : Number = 0.1 [static] | GameState |
actors | property |
public var actors:Array
actorsOfType | property |
public var actorsOfType:Array
actorsOnScreen | property |
public var actorsOnScreen:Array
actorsToCreateInNextScene | property |
public var actorsToCreateInNextScene:Array
actorsToRender | property |
public var actorsToRender:Array
allActors | property |
public var allActors:Array
behaviors | property |
public var behaviors:BehaviorManager
bottom | property |
public var bottom:int
bottomLayer | property |
public var bottomLayer:int
camera | property |
public var camera:Actor
debug | property |
public static var debug:Boolean = false
debugDraw | property |
public static var debugDraw:Boolean = false
debugDrawer | property |
public static var debugDrawer:b2DebugDraw
dynamicTiles | property |
public var dynamicTiles:Dictionary
enterTimer | property |
public var enterTimer:Number = 0
g | property |
public var g:Graphics
gameAttributes | property |
public var gameAttributes:Array
gameID | property |
public static var gameID:int
gameName | property |
public static var gameName:String
groups | property |
public var groups:Array
hudActors | property |
public var hudActors:HashSet
initSceneID | property |
public static var initSceneID:int = -1
isLocalGame | property |
public var isLocalGame:Boolean
ITERATIONS | property |
public static var ITERATIONS:int = 3
joints | property |
public var joints:Array
layerOrders | property |
public var layerOrders:Array
layers | property |
public var layers:Array
layersToDraw | property |
public var layersToDraw:Array
leaveTimer | property |
public var leaveTimer:Number = 0
left | property |
public var left:int
middleLayer | property |
public var middleLayer:int
nextID | property |
public var nextID:uint
numLeft | property |
public static var numLeft:int = 0
parallax | property |
public var parallax:ParallaxArea
password | property |
public static var password:String = Offline
physicsScale | property |
public static var physicsScale:Number = 10.0
playfield | property |
public var playfield:Area
PSCALE | property |
public static var PSCALE:Number = 1.0
recycledActorsOfType | property |
public var recycledActorsOfType:Array
regions | property |
public var regions:Array
right | property |
public var right:int
rootPanel | property |
public var rootPanel:Panel
rootPanelLayer | property |
public var rootPanelLayer:int = -1
scene | property |
public var scene:Scene
startCounter | property |
public var startCounter:int = 3000
started | property |
public var started:Boolean = false
STEP_SIZE | property |
public static var STEP_SIZE:Number
STEP_SIZE_MS | property |
public static var STEP_SIZE_MS:Number
terrainRegions | property |
public var terrainRegions:Array
tileLayers | property |
public var tileLayers:Array
top | property |
public var top:int
topLayer | property |
public var topLayer:int
username | property |
public static var username:String = Offline
world | property |
public var world:b2World
addAlwaysOnActor | () | method |
addHUDActor | () | method |
addJoint | () | method |
addRegion | () | method |
addTask | () | method |
addTerrainRegion | () | method |
begin | () | method |
public function begin():void
bringForward | () | method |
bringRootPanelForward | () | method |
public function bringRootPanelForward():void
bringRootPanelToFront | () | method |
public function bringRootPanelToFront():void
bringToFront | () | method |
cacheActors | () | method |
public function cacheActors():Array
ReturnsArray |
cameraFollow | () | method |
public function cameraFollow(actor:Actor, lockX:Boolean = true, lockY:Boolean = true):void
Parameters
actor:Actor | |
lockX:Boolean (default = true )
| |
lockY:Boolean (default = true )
|
cleanup | () | method |
public function cleanup():void
create | () | method |
override public function create():void
createActor | () | method |
public function createActor(ai:ActorInstance, offset:Boolean = false):Actor
Parameters
ai:ActorInstance | |
offset:Boolean (default = false )
|
Actor |
createActorInNextScene | () | method |
public function createActorInNextScene(type:ActorType, x:int, y:int, layer:int):void
Parameters
type:ActorType | |
x:int | |
y:int | |
layer:int |
createActorOfType | () | method |
public function createActorOfType(type:ActorType, x:Number, y:Number, layerConst:int):Actor
Parameters
type:ActorType | |
x:Number | |
y:Number | |
layerConst:int |
Actor |
createBoxRegion | () | method |
public function createBoxRegion(x:Number, y:Number, w:Number, h:Number):Region
Parameters
x:Number | |
y:Number | |
w:Number | |
h:Number |
Region |
createBoxTerrainRegion | () | method |
public function createBoxTerrainRegion(x:Number, y:Number, w:Number, h:Number, groupID:int = 1):TerrainRegion
Parameters
x:Number | |
y:Number | |
w:Number | |
h:Number | |
groupID:int (default = 1 )
|
TerrainRegion |
createCircularRegion | () | method |
public function createCircularRegion(x:Number, y:Number, r:Number):Region
Parameters
x:Number | |
y:Number | |
r:Number |
Region |
createCircularTerrainRegion | () | method |
public function createCircularTerrainRegion(x:Number, y:Number, r:Number, groupID:int = 1):TerrainRegion
Parameters
x:Number | |
y:Number | |
r:Number | |
groupID:int (default = 1 )
|
TerrainRegion |
createCustomStickJoint | () | method |
public function createCustomStickJoint(one:b2Body, x1:Number, y1:Number, two:b2Body, x2:Number, y2:Number):b2DistanceJoint
Parameters
one:b2Body | |
x1:Number | |
y1:Number | |
two:b2Body | |
x2:Number | |
y2:Number |
b2DistanceJoint |
createDynamicTile | () | method |
public function createDynamicTile(shape:b2Shape, x:Number, y:Number, layerID:Number, width:Number, height:Number):void
Parameters
shape:b2Shape | |
x:Number | |
y:Number | |
layerID:Number | |
width:Number | |
height:Number |
createHingeJoint | () | method |
public function createHingeJoint(one:b2Body, two:b2Body = null, pt:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, torque:Number = 0, speed:Number = 0):b2RevoluteJoint
Parameters
one:b2Body | |
two:b2Body (default = null )
| |
pt:V2 (default = null )
| |
jointID:int (default = -1 )
| |
collide:Boolean (default = false )
| |
limit:Boolean (default = false )
| |
motor:Boolean (default = false )
| |
lower:Number (default = 0 )
| |
upper:Number (default = 0 )
| |
torque:Number (default = 0 )
| |
speed:Number (default = 0 )
|
b2RevoluteJoint |
createSlidingJoint | () | method |
public function createSlidingJoint(one:b2Body, two:b2Body = null, dir:V2 = null, jointID:int = -1, collide:Boolean = false, limit:Boolean = false, motor:Boolean = false, lower:Number = 0, upper:Number = 0, force:Number = 0, speed:Number = 0):b2LineJoint
Parameters
one:b2Body | |
two:b2Body (default = null )
| |
dir:V2 (default = null )
| |
jointID:int (default = -1 )
| |
collide:Boolean (default = false )
| |
limit:Boolean (default = false )
| |
motor:Boolean (default = false )
| |
lower:Number (default = 0 )
| |
upper:Number (default = 0 )
| |
force:Number (default = 0 )
| |
speed:Number (default = 0 )
|
b2LineJoint |
createStickJoint | () | method |
public function createStickJoint(one:b2Body, two:b2Body, jointID:int = -1, collide:Boolean = false, damping:Number = 0, frequencyHz:Number = 0):b2DistanceJoint
Parameters
one:b2Body | |
two:b2Body | |
jointID:int (default = -1 )
| |
collide:Boolean (default = false )
| |
damping:Number (default = 0 )
| |
frequencyHz:Number (default = 0 )
|
b2DistanceJoint |
destroyJoint | () | method |
disableGlobalSleeping | () | method |
public function disableGlobalSleeping():void
enableGlobalSleeping | () | method |
public function enableGlobalSleeping():void
enterScene | () | method |
public function enterScene():void
getActor | () | method |
getActorsOfType | () | method |
getBottomLayer | () | method |
public function getBottomLayer():int
Returnsint |
getGameAttribute | () | method |
public function getGameAttribute(name:String):*
Parameters
name:String |
* |
getGroup | () | method |
public function getGroup(ID:Number, a:Actor = null):FlxGroup
Parameters
ID:Number | |
a:Actor (default = null )
|
FlxGroup |
getIDFromLayerOrder | () | method |
public function getIDFromLayerOrder(layerOrder:int):int
Parameters
layerOrder:int |
int |
getJoint | () | method |
getMiddleLayer | () | method |
public function getMiddleLayer():int
Returnsint |
getOrderForLayerID | () | method |
public function getOrderForLayerID(layerID:int):int
Parameters
layerID:int |
int |
getPhysicalHeight | () | method |
public function getPhysicalHeight():Number
ReturnsNumber |
getPhysicalWidth | () | method |
public function getPhysicalWidth():Number
ReturnsNumber |
getRecycledActorOfType | () | method |
public function getRecycledActorOfType(type:ActorType, x:Number, y:Number, layerConst:int):Actor
Parameters
type:ActorType | |
x:Number | |
y:Number | |
layerConst:int |
Actor |
getRecycledActorsOfType | () | method |
public function getRecycledActorsOfType(type:ActorType):HashSet
Parameters
type:ActorType |
HashSet |
getRegion | () | method |
getRegions | () | method |
public function getRegions(ID:int):Array
Parameters
ID:int |
Array |
getTerrainRegion | () | method |
getTerrainRegions | () | method |
public function getTerrainRegions(ID:int):Array
Parameters
ID:int |
Array |
getTopLayer | () | method |
public function getTopLayer():int
Returnsint |
getValue | () | method |
public function getValue(behaviorName:String, attributeName:String):Object
Parameters
behaviorName:String | |
attributeName:String |
Object |
initBehaviors | () | method |
public static function initBehaviors(manager:BehaviorManager, behaviorValues:Array, parent:Object, game:GameState, initialize:Boolean):void
Parameters
manager:BehaviorManager | |
behaviorValues:Array | |
parent:Object | |
game:GameState | |
initialize:Boolean |
initPhysics | () | method |
public function initPhysics():void
innerUpdate | () | method |
public function innerUpdate():void
isInRegion | () | method |
isTransitioning | () | method |
public function isTransitioning():Boolean
ReturnsBoolean |
leaveScene | () | method |
public function leaveScene():void
loadActors | () | method |
public function loadActors():void
loadCamera | () | method |
public function loadCamera():void
loadScene | () | method |
public function loadScene(sceneID:Number):void
Parameters
sceneID:Number |
loadTerrain | () | method |
public function loadTerrain():void
moveToLayerOrder | () | method |
nextJointID | () | method |
public function nextJointID():int
Returnsint |
nextRegionID | () | method |
public function nextRegionID():int
Returnsint |
nextTerrainRegionID | () | method |
public function nextTerrainRegionID():int
Returnsint |
recycleActor | () | method |
removeActor | () | method |
removeHUDActor | () | method |
removeRegion | () | method |
public function removeRegion(ID:int):void
Parameters
ID:int |
removeTerrainRegion | () | method |
public function removeTerrainRegion(ID:int):void
Parameters
ID:int |
render | () | method |
override public function render():void
say | () | method |
public function say(behaviorName:String, msg:String, args:Array):Object
Parameters
behaviorName:String | |
msg:String | |
args:Array |
Object |
sendBackward | () | method |
sendRootPanelBack | () | method |
public function sendRootPanelBack():void
sendRootPanelToBack | () | method |
public function sendRootPanelToBack():void
sendToBack | () | method |
setGameAttribute | () | method |
public function setGameAttribute(name:String, value:*):void
Parameters
name:String | |
value:* |
setOffscreenTolerance | () | method |
public function setOffscreenTolerance(top:int, left:int, bottom:int, right:int):void
Parameters
top:int | |
left:int | |
bottom:int | |
right:int |
setValue | () | method |
public function setValue(behaviorName:String, attributeName:String, value:Object):void
Parameters
behaviorName:String | |
attributeName:String | |
value:Object |
shout | () | method |
public function shout(msg:String, args:Array):Object
Parameters
msg:String | |
args:Array |
Object |
switchScene | () | method |
public function switchScene(sceneID:Number, leave:Transition = null, enter:Transition = null):void
Parameters
sceneID:Number | |
leave:Transition (default = null )
| |
enter:Transition (default = null )
|
toPhysicalUnits | () | method |
public static function toPhysicalUnits(value:Number):Number
Parameters
value:Number |
Number |
toPixelUnits | () | method |
public static function toPixelUnits(value:Number):Number
Parameters
value:Number |
Number |
update | () | method |
override public function update():void
vToPhysicalUnits | () | method |
vToPixelUnits | () | method |
MAX_ELAPSED | Constant |
public static const MAX_ELAPSED:Number = 0.1