Package | org.flixel |
Class | public class FlxBlock |
Inheritance | FlxBlock ![]() |
Property | Defined by | ||
---|---|---|---|
![]() | _flicker : Boolean
Internal helper used for retro-style flickering.
| FlxCore | |
![]() | _flickerTimer : Number
Internal helper used for retro-style flickering.
| FlxCore | |
_p : Point
Helper variable used during rendering.
| FlxBlock | ||
_pixels : BitmapData
Stores the tile strip from which the tiles are loaded.
| FlxBlock | ||
_rects : Array
Array of rectangles used to quickly blit the tiles to the screen.
| FlxBlock | ||
_tileSize : uint
The size of the tiles (e.g.
| FlxBlock |
Method | Defined by | ||
---|---|---|---|
FlxBlock(X:int, Y:int, Width:uint, Height:uint)
Creates a new
FlxBlock object with the specified position and size. | FlxBlock | ||
![]() |
Collides a
FlxCore against this object. | FlxCore | |
![]() |
collideArray(Cores:Array):void
Collides an array of
FlxCore objects against the tilemap. | FlxCore | |
![]() |
collideArrayX(Cores:Array):void
Collides an array of
FlxCore objects against the tilemap against the X axis only. | FlxCore | |
![]() |
collideArrayY(Cores:Array):void
Collides an array of
FlxCore objects against the tilemap against the Y axis only. | FlxCore | |
![]() |
Collides a
FlxCore against this object on the X axis ONLY. | FlxCore | |
![]() |
Collides a
FlxCore against this object on the Y axis ONLY. | FlxCore | |
![]() |
destroy():void
Called by
FlxLayer when states are changed (if it belongs to a layer)
| FlxCore | |
![]() |
flicker(Duration:Number = 1):void
Tells this object to flicker, retro-style.
| FlxCore | |
![]() |
flickering():Boolean
Check to see if the object is still flickering.
| FlxCore | |
![]() |
getScreenXY(P:Point = null):Point
Call this function to figure out the on-screen position of the object.
| FlxCore | |
![]() |
hitCeiling(Contact:FlxCore = null):Boolean
Called when this object collides with the bottom of another
FlxCore . | FlxCore | |
![]() |
Called when this object collides with the top of another
FlxCore . | FlxCore | |
![]() |
Called when this object collides with another
FlxCore on one of its sides. | FlxCore | |
![]() |
kill():void
Call this function to "kill" a sprite so that it no longer 'exists'.
| FlxCore | |
loadGraphic(TileGraphic:Class, Empties:uint = 0):void
Fills the block with a randomly arranged selection of graphics from the image provided.
| FlxBlock | ||
![]() |
onScreen():Boolean
Check and see if this object is currently on screen.
| FlxCore | |
![]() |
Checks to see if some
FlxCore object overlaps this FlxCore object. | FlxCore | |
![]() |
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
Draws this block.
| FlxBlock | ||
![]() |
reset(X:Number, Y:Number):void
Handy function for reviving game objects.
| FlxCore | |
![]() |
update():void
Just updates the flickering.
| FlxCore |
_p | property |
protected var _p:Point
Helper variable used during rendering.
_pixels | property |
protected var _pixels:BitmapData
Stores the tile strip from which the tiles are loaded.
_rects | property |
protected var _rects:Array
Array of rectangles used to quickly blit the tiles to the screen.
_tileSize | property |
protected var _tileSize:uint
The size of the tiles (e.g. 8 means 8x8).
FlxBlock | () | constructor |
public function FlxBlock(X:int, Y:int, Width:uint, Height:uint)
Creates a new FlxBlock
object with the specified position and size.
X:int — The X position of the block.
|
|
Y:int — The Y position of the block.
|
|
Width:uint — The width of the block.
|
|
Height:uint — The height of the block.
|
loadGraphic | () | method |
public function loadGraphic(TileGraphic:Class, Empties:uint = 0):void
Fills the block with a randomly arranged selection of graphics from the image provided.
ParametersTileGraphic:Class — The graphic class that contains the tiles that should fill this block.
|
|
Empties:uint (default = 0 ) — The number of "empty" tiles to add to the auto-fill algorithm (e.g. 8 tiles + 4 empties = 1/3 of block will be open holes).
|
render | () | method |
public override function render():void
Draws this block.