Package | org.flixel |
Class | public class FlxState |
Inheritance | FlxState flash.display.Sprite |
Subclasses | GameState |
FlxGroup
.
This means you can load it up with regular Flash stuff
or with flixel elements, whatever works!
Property | Defined By | ||
---|---|---|---|
bgColor : uint [static]
This static variable indicates the "clear color"
or default background color of the game. | FlxState | ||
defaultGroup : FlxGroup
Internal group used to organize and display objects you add to this state. | FlxState | ||
screen : FlxSprite [static]
This static variable holds the screen buffer,
so you can draw to it directly if you want. | FlxState |
Method | Defined By | ||
---|---|---|---|
FlxState()
Creates a new FlxState object,
instantiating screen if necessary. | FlxState | ||
Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the game loop. | FlxState | ||
collide():void
This function collides defaultGroup against defaultGroup
(basically everything you added to this state). | FlxState | ||
create():void
Override this function to set up your game state. | FlxState | ||
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 | ||
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 | ||
render():void
Automatically goes through and calls render on everything you added to the game loop,
override this loop to manually control the rendering process. | FlxState | ||
update():void
Automatically goes through and calls update on everything you added to the game loop,
override this function to handle custom input and perform collisions/
| FlxState |
bgColor | property |
public static var bgColor:uint
This static variable indicates the "clear color"
or default background color of the game.
Change it at ANY time using FlxState.bgColor
.
defaultGroup | property |
public var defaultGroup:FlxGroup
Internal group used to organize and display objects you add to this state.
screen | property |
public static var screen:FlxSprite
This static variable holds the screen buffer, so you can draw to it directly if you want.
FlxState | () | Constructor |
public function FlxState()
Creates a new FlxState
object,
instantiating screen
if necessary.
add | () | method |
public function add(Core:FlxObject):FlxObject
Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the game loop. FlxState is adding this object to its built-in FlxGroup to automate updating and rendering.
Parameters
Core:FlxObject — The object you want to add to the game loop.
|
FlxObject |
collide | () | method |
public function collide():void
This function collides defaultGroup
against defaultGroup
(basically everything you added to this state).
create | () | method |
public function create():void
Override this function to set up your game state. This is where you create your groups and game objects and all that good stuff.
destroy | () | method |
public function 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).
postProcess | () | method |
public function postProcess():void
Override this function to do special pre-processing FX like light bloom.
You can use scaling or blending modes or whatever you want against
FlxState.screen
to achieve all sorts of cool FX.
preProcess | () | method |
public function preProcess():void
Override this function to do special pre-processing FX like motion blur.
You can use scaling or blending modes or whatever you want against
FlxState.screen
to achieve all sorts of cool FX.
render | () | method |
public function render():void
Automatically goes through and calls render on everything you added to the game loop, override this loop to manually control the rendering process.
update | () | method |
public function update():void
Automatically goes through and calls update on everything you added to the game loop, override this function to handle custom input and perform collisions/