Package | net.flashpunk.graphics |
Class | public class TiledSpritemap |
Inheritance | TiledSpritemap ![]() ![]() ![]() ![]() |
Property | Defined By | ||
---|---|---|---|
![]() | active : Boolean = false
If the graphic should update. | Graphic | |
![]() | alpha : Number
Change the opacity of the Image, a value from 0 to 1. | Image | |
![]() | angle : Number = 0
Rotation of the image, in degrees. | Image | |
![]() | blend : String
Optional blend mode to use when drawing this image. | Image | |
![]() | callback : Function
Optional callback function for animation end. | Spritemap | |
![]() | clipRect : Rectangle [override] [read-only]
Clipping rectangle for the spritemap. | Spritemap | |
![]() | color : uint
The tinted color of the Image. | Image | |
![]() | columns : uint [read-only]
Columns in the Spritemap. | Spritemap | |
![]() | complete : Boolean = true
If the animation has stopped. | Spritemap | |
![]() | currentAnim : String [read-only]
The currently playing animation. | Spritemap | |
![]() | drawMask : BitmapData
Set the transparency mask of the Image. | Image | |
![]() | flipped : Boolean
If you want to draw the Image horizontally flipped. | Image | |
![]() | frame : int
Sets the current frame index. | Spritemap | |
![]() | frameCount : uint [read-only]
The amount of frames in the Spritemap. | Spritemap | |
![]() | height : uint [read-only]
Height of the image. | Image | |
![]() | index : uint
Current index of the playing animation. | Spritemap | |
![]() | locked : Boolean [read-only]
True if the image is locked. | Image | |
offsetX : Number
The x-offset of the texture. | TiledSpritemap | ||
offsetY : Number
The y-offset of the texture. | TiledSpritemap | ||
![]() | originX : Number = 0
X origin of the image, determines transformation point. | Image | |
![]() | originY : Number = 0
Y origin of the image, determines transformation point. | Image | |
![]() | rate : Number = 1
Animation speed factor, alter this to speed up/slow down all animations. | Spritemap | |
![]() | relative : Boolean = true
If the graphic should render at its position relative to its parent Entity's position. | Graphic | |
![]() | rows : uint [read-only]
Rows in the Spritemap. | Spritemap | |
![]() | scale : Number = 1
Scale of the image, affects both x and y scale. | Image | |
![]() | scaledHeight : Number
The scaled height of the image. | Image | |
![]() | scaledWidth : Number
The scaled width of the image. | Image | |
![]() | scaleX : Number = 1
X scale of the image. | Image | |
![]() | scaleY : Number = 1
Y scale of the image. | Image | |
![]() | scrollX : Number = 1
X scrollfactor, effects how much the camera offsets the drawn graphic. | Graphic | |
![]() | scrollY : Number = 1
Y scrollfactor, effects how much the camera offsets the drawn graphic. | Graphic | |
![]() | smooth : Boolean
If the image should be drawn transformed with pixel smoothing. | Image | |
![]() | tinting : Number
The amount the image will be tinted, suggested values from
0 to 1. | Image | |
![]() | tintMode : Number
The tint mode - multiply or colorize. | Image | |
![]() | visible : Boolean = true
If the graphic should render. | Graphic | |
![]() | width : uint [read-only]
Width of the image. | Image | |
![]() | x : Number = 0
X offset. | Graphic | |
![]() | y : Number = 0
Y offset. | Graphic |
Method | Defined By | ||
---|---|---|---|
TiledSpritemap(source:*, frameWidth:uint = 0, frameHeight:uint = 0, width:uint = 0, height:uint = 0, callback:Function = null)
Constructs the tiled spritemap. | TiledSpritemap | ||
![]() |
Add an Animation. | Spritemap | |
![]() | centerOO():void
Centers the Image's originX/Y to its center. | Image | |
![]() | centerOrigin():void
Centers the Image's originX/Y to its center. | Image | |
![]() | clear():void
Clears the image buffer. | Image | |
![]() | createCircle(radius:uint, color:uint = 0xFFFFFF, alpha:Number = 1):Image [static]
Creates a new circle Image. | Image | |
![]() | createGradient(width:uint, height:uint, fromX:Number, fromY:Number, toX:Number, toY:Number, fromColor:uint, toColor:uint, fromAlpha:Number = 1, toAlpha:Number = 1):Image [static]
Creates a new gradient Image. | Image | |
![]() | createRect(width:uint, height:uint, color:uint = 0xFFFFFF, alpha:Number = 1):Image [static]
Creates a new rectangle Image. | Image | |
![]() | getFrame(column:uint = 0, row:uint = 0):uint
Gets the frame index based on the column and row of the source image. | Spritemap | |
![]() | lock():void
Lock the image, preventing updateBuffer() from being run until
unlock() is called, for performance. | Image | |
![]() |
Plays an animation. | Spritemap | |
![]() | randFrame():void
Assigns the Spritemap to a random frame. | Spritemap | |
![]() | render(target:BitmapData, point:Point, camera:Point):void
Renders the graphic to the screen buffer. | Graphic | |
![]() | setAnimFrame(name:String, index:int):void
Sets the frame to the frame index of an animation. | Spritemap | |
![]() | setFrame(column:uint = 0, row:uint = 0):void
Sets the current display frame based on the column and row of the source image. | Spritemap | |
setOffset(x:Number, y:Number):void
Sets the texture offset. | TiledSpritemap | ||
![]() | unlock():void
Unlock the image. | Image | |
![]() | update():void
Updates the graphic. | Graphic | |
![]() | updateBuffer(clearBefore:Boolean = false):void [override]
Updates the spritemap's buffer. | Spritemap |
offsetX | property |
offsetX:Number
The x-offset of the texture.
public function get offsetX():Number
public function set offsetX(value:Number):void
offsetY | property |
offsetY:Number
The y-offset of the texture.
public function get offsetY():Number
public function set offsetY(value:Number):void
TiledSpritemap | () | Constructor |
public function TiledSpritemap(source:*, frameWidth:uint = 0, frameHeight:uint = 0, width:uint = 0, height:uint = 0, callback:Function = null)
Constructs the tiled spritemap.
Parameterssource:* — Source image.
| |
frameWidth:uint (default = 0 ) — Frame width.
| |
frameHeight:uint (default = 0 ) — Frame height.
| |
width:uint (default = 0 ) — Width of the block to render.
| |
height:uint (default = 0 ) — Height of the block to render.
| |
callback:Function (default = null ) — Optional callback function for animation end.
|
setOffset | () | method |
public function setOffset(x:Number, y:Number):void
Sets the texture offset.
Parameters
x:Number — The x-offset.
| |
y:Number — The y-offset.
|