Packageorg.flixel
Classpublic class FlxBasic
InheritanceFlxBasic Inheritance Object
Subclasses DebugPathDisplay, FlxCamera, FlxGroup, FlxObject, FlxSound, TimerManager

This is a useful "generic" Flixel object. Both FlxObject and FlxGroup extend this class, as do the plugins. Has no size, position or graphical data.



Public Properties
 PropertyDefined By
  active : Boolean
Controls whether update() is automatically called by FlxState/FlxGroup.
FlxBasic
  _ACTIVECOUNT : uint
[static]
FlxBasic
  alive : Boolean
Useful state for many game objects - "dead" (!alive) vs alive.
FlxBasic
  cameras : Array
An array of camera objects that this object will use during draw().
FlxBasic
  exists : Boolean
Controls whether update() and draw() are automatically called by FlxState/FlxGroup.
FlxBasic
  ID : int
IDs seem like they could be pretty useful, huh? They're not actually used for anything yet though.
FlxBasic
  ignoreDrawDebug : Boolean
Setting this to true will prevent the object from appearing when the visual debug mode in the debugger overlay is toggled on.
FlxBasic
  visible : Boolean
Controls whether draw() is automatically called by FlxState/FlxGroup.
FlxBasic
  _VISIBLECOUNT : uint
[static]
FlxBasic
Public Methods
 MethodDefined By
  
Instantiate the basic flixel object.
FlxBasic
  
destroy():void
Override this function to null out variables or manually call destroy() on class members if necessary.
FlxBasic
  
draw():void
Override this function to control how the object is drawn.
FlxBasic
  
drawDebug(Camera:FlxCamera = null):void
Override this function to draw custom "debug mode" graphics to the specified camera while the debugger's visual mode is toggled on.
FlxBasic
  
kill():void
Handy function for "killing" game objects.
FlxBasic
  
postUpdate():void
Post-update is called right after update() on each object in the game loop.
FlxBasic
  
preUpdate():void
Pre-update is called right before update() on each object in the game loop.
FlxBasic
  
revive():void
Handy function for bringing game objects "back to life".
FlxBasic
  
toString():String
Convert object to readable string name.
FlxBasic
  
update():void
Override this function to update your class's position and appearance.
FlxBasic
Property Detail
_ACTIVECOUNTproperty
public static var _ACTIVECOUNT:uint

_VISIBLECOUNTproperty 
public static var _VISIBLECOUNT:uint

activeproperty 
public var active:Boolean

Controls whether update() is automatically called by FlxState/FlxGroup.

aliveproperty 
public var alive:Boolean

Useful state for many game objects - "dead" (!alive) vs alive. kill() and revive() both flip this switch (along with exists, but you can override that).

camerasproperty 
public var cameras:Array

An array of camera objects that this object will use during draw(). This value will initialize itself during the first draw to automatically point at the main camera list out in FlxG unless you already set it. You can also change it afterward too, very flexible!

existsproperty 
public var exists:Boolean

Controls whether update() and draw() are automatically called by FlxState/FlxGroup.

IDproperty 
public var ID:int

IDs seem like they could be pretty useful, huh? They're not actually used for anything yet though.

ignoreDrawDebugproperty 
public var ignoreDrawDebug:Boolean

Setting this to true will prevent the object from appearing when the visual debug mode in the debugger overlay is toggled on.

visibleproperty 
public var visible:Boolean

Controls whether draw() is automatically called by FlxState/FlxGroup.

Constructor Detail
FlxBasic()Constructor
public function FlxBasic()

Instantiate the basic flixel object.

Method Detail
destroy()method
public function destroy():void

Override this function to null out variables or manually call destroy() on class members if necessary. Don't forget to call super.destroy()!

draw()method 
public function draw():void

Override this function to control how the object is drawn. Overriding draw() is rarely necessary, but can be very useful.

drawDebug()method 
public function drawDebug(Camera:FlxCamera = null):void

Override this function to draw custom "debug mode" graphics to the specified camera while the debugger's visual mode is toggled on.

Parameters

Camera:FlxCamera (default = null) — Which camera to draw the debug visuals to.

kill()method 
public function kill():void

Handy function for "killing" game objects. Default behavior is to flag them as nonexistent AND dead. However, if you want the "corpse" to remain in the game, like to animate an effect or whatever, you should override this, setting only alive to false, and leaving exists true.

postUpdate()method 
public function postUpdate():void

Post-update is called right after update() on each object in the game loop.

preUpdate()method 
public function preUpdate():void

Pre-update is called right before update() on each object in the game loop.

revive()method 
public function revive():void

Handy function for bringing game objects "back to life". Just sets alive and exists back to true. In practice, this function is most often called by FlxObject.reset().

toString()method 
public function toString():String

Convert object to readable string name. Useful for debugging, save games, etc.

Returns
String
update()method 
public function update():void

Override this function to update your class's position and appearance. This is where most of your game rules and behavioral code will go.