Package | org.flixel |
Class | public class FlxTileblock |
Inheritance | FlxTileblock ![]() ![]() ![]() ![]() |
Method | Defined by | ||
---|---|---|---|
FlxTileblock(X:int, Y:int, Width:uint, Height:uint)
Creates a new
FlxBlock object with the specified position and size. | FlxTileblock | ||
![]() |
addAnimation(Name:String, Frames:Array, FrameRate:Number = 0, Looped:Boolean = true):void
Adds a new animation to the sprite.
| FlxSprite | |
![]() |
addAnimationCallback(AnimationCallback:Function):void
Pass in a function to be called whenever this sprite's animation changes.
| FlxSprite | |
![]() |
If you don't want to call
FlxU.collide() you can use this instead. | FlxObject | |
![]() |
createGraphic(Width:uint, Height:uint, Color:uint = 0xffffffff, Unique:Boolean = false, Key:String = null):FlxSprite
This function creates a flat colored square image dynamically.
| FlxSprite | |
![]() |
destroy():void
Called by
FlxGroup , commonly when game states are changed. | FlxObject | |
![]() |
This function draws or stamps one
FlxSprite onto another. | FlxSprite | |
![]() |
drawLine(StartX:Number, StartY:Number, EndX:Number, EndY:Number, Color:uint, Thickness:uint = 1):void
This function draws a line on this sprite from position X1,Y1
to position X2,Y2 with the specified color.
| FlxSprite | |
![]() |
fill(Color:uint):void
Fills this sprite's graphic with a specific color.
| FlxSprite | |
![]() |
flicker(Duration:Number = 1):void
Tells this object to flicker, retro-style.
| FlxObject | |
![]() |
flickering():Boolean
Check to see if the object is still flickering.
| FlxObject | |
![]() |
getBoundingColor():uint
Returns the appropriate color for the bounding box depending on object state.
| FlxObject | |
![]() |
Call this function to figure out the on-screen position of the object.
| FlxSprite | |
![]() |
Called when this object's bottom edge collides with the top of another
FlxObject . | FlxObject | |
![]() |
Called when this object's left side collides with another
FlxObject 's right. | FlxObject | |
![]() |
Called when this object's right side collides with another
FlxObject 's left. | FlxObject | |
![]() |
Since most games have identical behavior for running into walls,
you can just override this function instead of overriding both hitLeft and hitRight.
| FlxObject | |
![]() |
Called when this object's top collides with the bottom of another
FlxObject . | FlxObject | |
![]() |
hurt(Damage:Number):void
Call this function to "damage" (or give health bonus) to this sprite.
| FlxObject | |
![]() |
kill():void
Call this function to "kill" a sprite so that it no longer 'exists'.
| FlxObject | |
loadGraphic(Graphic:Class, Animated:Boolean = false, Reverse:Boolean = false, Width:uint = 0, Height:uint = 0, Unique:Boolean = false):FlxSprite
NOTE: MOST OF THE TIME YOU SHOULD BE USING LOADTILES(), NOT LOADGRAPHIC()!
LoadTiles() has a lot more functionality, can load non-square tiles, etc. | FlxTileblock | ||
![]() |
loadRotatedGraphic(Graphic:Class, Rotations:uint = 16, Frame:int = -1, AntiAliasing:Boolean = false, AutoBuffer:Boolean = false):FlxSprite
Create a pre-rotated sprite sheet from a simple sprite.
| FlxSprite | |
loadTiles(TileGraphic:Class, TileWidth:uint = 0, TileHeight:uint = 0, Empties:uint = 0):FlxTileblock
Fills the block with a randomly arranged selection of graphics from the image provided.
| FlxTileblock | ||
![]() |
onEmit():void
Triggered whenever this sprite is launched by a
FlxEmitter . | FlxSprite | |
![]() |
onScreen():Boolean
Check and see if this object is currently on screen.
| FlxObject | |
![]() |
Checks to see if some
FlxObject object overlaps this FlxObject object. | FlxObject | |
![]() |
overlapsPoint(X:Number, Y:Number, PerPixel:Boolean = false):Boolean
Checks to see if a point in 2D space overlaps this FlxCore object.
| FlxSprite | |
![]() |
play(AnimName:String, Force:Boolean = false):void
Plays an existing animation (e.g.
| FlxSprite | |
![]() |
preCollide(Object:FlxObject):void
FlxU.collide() (and thus FlxObject.collide() ) call
this function each time two objects are compared to see if they collide. | FlxObject | |
![]() |
randomFrame():void
Tell the sprite to change to a random frame of animation
Useful for instantiating particles or other weird things.
| FlxSprite | |
![]() |
refreshHulls():void
Called by
FlxObject.updateMotion() and some constructors to
rebuild the basic collision data for this object. | FlxObject | |
![]() |
render():void
Called by game loop, updates then blits or renders current frame of animation to the screen
| FlxSprite | |
![]() |
reset(X:Number, Y:Number):void
Handy function for reviving game objects.
| FlxObject | |
![]() |
toString():String
Convert object to readable string name.
| FlxPoint | |
![]() |
unsafeBind(Pixels:BitmapData):void
Internal function, currently only used to quickly update FlxState.screen for post-processing.
| FlxSprite | |
![]() |
update():void
Main game loop update function.
| FlxSprite |
FlxTileblock | () | constructor |
public function FlxTileblock(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 override function loadGraphic(Graphic:Class, Animated:Boolean = false, Reverse:Boolean = false, Width:uint = 0, Height:uint = 0, Unique:Boolean = false):FlxSprite
NOTE: MOST OF THE TIME YOU SHOULD BE USING LOADTILES(), NOT LOADGRAPHIC()!
LoadTiles()
has a lot more functionality, can load non-square tiles, etc.
Load an image from an embedded graphic file and use it to auto-fill this block with tiles.
Graphic:Class — The image you want to use.
|
|
Animated:Boolean (default = false ) — Ignored.
|
|
Reverse:Boolean (default = false ) — Ignored.
|
|
Width:uint (default = 0 ) — Ignored.
|
|
Height:uint (default = 0 ) — Ignored.
|
|
Unique:Boolean (default = false ) — Ignored.
|
FlxSprite —
This FlxSprite instance (nice for chaining stuff together, if you're into that).
|
loadTiles | () | method |
public function loadTiles(TileGraphic:Class, TileWidth:uint = 0, TileHeight:uint = 0, Empties:uint = 0):FlxTileblock
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.
|
|
TileWidth: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).
|
|
TileHeight:uint (default = 0 )
|
|
Empties:uint (default = 0 )
|
FlxTileblock |