Packageorg.flixel
Classpublic class FlxLayer
InheritanceFlxLayer Inheritance FlxCore
SubclassesFlxPause

This is an organizational class that can update and render a bunch of FlxCore objects



Public Properties
 PropertyDefined by
 Inheritedactive : Boolean
If an object is not alive, the game loop will not automatically call update() on it.
FlxCore
 Inheriteddead : Boolean
If an object is dead, the functions that automate collisions will skip it (see FlxG.overlapArrays() and FlxG.collideArrays()).
FlxCore
 Inheritedexists : Boolean
Kind of a global on/off switch for any objects descended from FlxCore.
FlxCore
 Inheritedfixed : Boolean
If an object is 'fixed' in space, it will not budge when it collides with a not-fixed object.
FlxCore
 Inheritedheight : uint
FlxCore
 Inheritedlast : Point
Stores the last position of the sprite, used by collision detection algorithm.
FlxCore
 InheritedscrollFactor : Point
A point that can store numbers from 0 to 1 (for X and Y independently) that governs how much this object is affected by the camera subsystem.
FlxCore
 Inheritedvisible : Boolean
If an object is not visible, the game loop will not automatically call render() on it.
FlxCore
 Inheritedwidth : uint
FlxCore
 Inheritedx : Number
FlxCore
 Inheritedy : Number
FlxCore
Protected Properties
 PropertyDefined by
  _children : Array
Array of all the FlxCore objects that exist in this layer.
FlxLayer
 Inherited_flicker : Boolean
Internal helper used for retro-style flickering.
FlxCore
 Inherited_flickerTimer : Number
Internal helper used for retro-style flickering.
FlxCore
Public Methods
 MethodDefined by
  
Constructor
FlxLayer
  
add(Core:FlxCore, ShareScroll:Boolean = false):FlxCore
Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the list of children
FlxLayer
  
children():Array
Returns the array of children
FlxLayer
 Inherited
collide(Core:FlxCore):Boolean
Collides a FlxCore against this object.
FlxCore
 Inherited
collideArray(Cores:Array):void
Collides an array of FlxCore objects against the tilemap.
FlxCore
 Inherited
collideArrayX(Cores:Array):void
Collides an array of FlxCore objects against the tilemap against the X axis only.
FlxCore
 Inherited
collideArrayY(Cores:Array):void
Collides an array of FlxCore objects against the tilemap against the Y axis only.
FlxCore
 Inherited
collideX(Core:FlxCore):Boolean
Collides a FlxCore against this object on the X axis ONLY.
FlxCore
 Inherited
collideY(Core:FlxCore):Boolean
Collides a FlxCore against this object on the Y axis ONLY.
FlxCore
  
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.
FlxLayer
 Inherited
flicker(Duration:Number = 1):void
Tells this object to flicker, retro-style.
FlxCore
 Inherited
flickering():Boolean
Check to see if the object is still flickering.
FlxCore
 Inherited
getScreenXY(P:Point = null):Point
Call this function to figure out the on-screen position of the object.
FlxCore
 Inherited
hitCeiling(Contact:FlxCore = null):Boolean
Called when this object collides with the bottom of another FlxCore.
FlxCore
 Inherited
hitFloor(Contact:FlxCore = null):Boolean
Called when this object collides with the top of another FlxCore.
FlxCore
 Inherited
hitWall(Contact:FlxCore = null):Boolean
Called when this object collides with another FlxCore on one of its sides.
FlxCore
 Inherited
kill():void
Call this function to "kill" a sprite so that it no longer 'exists'.
FlxCore
 Inherited
onScreen():Boolean
Check and see if this object is currently on screen.
FlxCore
 Inherited
overlaps(Core:FlxCore):Boolean
Checks to see if some FlxCore object overlaps this FlxCore object.
FlxCore
 Inherited
overlapsPoint(X:Number, Y:Number, PerPixel:Boolean = false):Boolean
Checks to see if a point in 2D space overlaps this FlxCore object.
FlxCore
  
render():void
Automatically goes through and calls render on everything you added, override this loop to control render order manually.
FlxLayer
 Inherited
reset(X:Number, Y:Number):void
Handy function for reviving game objects.
FlxCore
  
update():void
Automatically goes through and calls update on everything you added, override this function to handle custom input and perform collisions.
FlxLayer
Property detail
_childrenproperty
protected var _children:Array

Array of all the FlxCore objects that exist in this layer.

Constructor detail
FlxLayer()constructor
public function FlxLayer()

Constructor

Method detail
add()method
public function add(Core:FlxCore, ShareScroll:Boolean = false):FlxCore

Adds a new FlxCore subclass (FlxSprite, FlxBlock, etc) to the list of children

Parameters
Core:FlxCore — The object you want to add
 
ShareScroll:Boolean (default = false) — Whether or not this FlxCore should sync up with this layer's scrollFactor

Returns
FlxCore — The same FlxCore object that was passed in.
children()method 
public function children():Array

Returns the array of children

Returns
Array
destroy()method 
public override 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.

render()method 
public override function render():void

Automatically goes through and calls render on everything you added, override this loop to control render order manually.

update()method 
public override function update():void

Automatically goes through and calls update on everything you added, override this function to handle custom input and perform collisions.