Packagenet.flashpunk.graphics
Classpublic class TiledSpritemap
InheritanceTiledSpritemap Inheritance Spritemap Inheritance Image Inheritance Graphic Inheritance Object

Special Spritemap object that can display blocks of animated sprites.



Public Properties
 PropertyDefined By
 Inheritedactive : Boolean = false
If the graphic should update.
Graphic
 Inheritedalpha : Number
Change the opacity of the Image, a value from 0 to 1.
Image
 Inheritedangle : Number = 0
Rotation of the image, in degrees.
Image
 Inheritedblend : String
Optional blend mode to use when drawing this image.
Image
 Inheritedcallback : Function
Optional callback function for animation end.
Spritemap
 InheritedclipRect : Rectangle
[override] [read-only] Clipping rectangle for the spritemap.
Spritemap
 Inheritedcolor : uint
The tinted color of the Image.
Image
 Inheritedcolumns : uint
[read-only] Columns in the Spritemap.
Spritemap
 Inheritedcomplete : Boolean = true
If the animation has stopped.
Spritemap
 InheritedcurrentAnim : String
[read-only] The currently playing animation.
Spritemap
 InheriteddrawMask : BitmapData
Set the transparency mask of the Image.
Image
 Inheritedflipped : Boolean
If you want to draw the Image horizontally flipped.
Image
 Inheritedframe : int
Sets the current frame index.
Spritemap
 InheritedframeCount : uint
[read-only] The amount of frames in the Spritemap.
Spritemap
 Inheritedheight : uint
[read-only] Height of the image.
Image
 Inheritedindex : uint
Current index of the playing animation.
Spritemap
 Inheritedlocked : 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
 InheritedoriginX : Number = 0
X origin of the image, determines transformation point.
Image
 InheritedoriginY : Number = 0
Y origin of the image, determines transformation point.
Image
 Inheritedrate : Number = 1
Animation speed factor, alter this to speed up/slow down all animations.
Spritemap
 Inheritedrelative : Boolean = true
If the graphic should render at its position relative to its parent Entity's position.
Graphic
 Inheritedrows : uint
[read-only] Rows in the Spritemap.
Spritemap
 Inheritedscale : Number = 1
Scale of the image, affects both x and y scale.
Image
 InheritedscaledHeight : Number
The scaled height of the image.
Image
 InheritedscaledWidth : Number
The scaled width of the image.
Image
 InheritedscaleX : Number = 1
X scale of the image.
Image
 InheritedscaleY : Number = 1
Y scale of the image.
Image
 InheritedscrollX : Number = 1
X scrollfactor, effects how much the camera offsets the drawn graphic.
Graphic
 InheritedscrollY : Number = 1
Y scrollfactor, effects how much the camera offsets the drawn graphic.
Graphic
 Inheritedsmooth : Boolean
If the image should be drawn transformed with pixel smoothing.
Image
 Inheritedtinting : Number
The amount the image will be tinted, suggested values from 0 to 1.
Image
 InheritedtintMode : Number
The tint mode - multiply or colorize.
Image
 Inheritedvisible : Boolean = true
If the graphic should render.
Graphic
 Inheritedwidth : uint
[read-only] Width of the image.
Image
 Inheritedx : Number = 0
X offset.
Graphic
 Inheritedy : Number = 0
Y offset.
Graphic
Protected Properties
 PropertyDefined By
 Inherited_alpha : Number = 1
Image
 Inheritedassign : Function
Graphic
 Inherited_class : String
Image
 Inherited_color : uint = 0x00FFFFFF
Image
 Inherited_colorTransform : ColorTransform
Image
 Inherited_drawMask : BitmapData
Image
 Inherited_flip : BitmapData
Image
 Inherited_flipped : Boolean
Image
 Inherited_flips : Object
[static]
Image
 Inherited_matrix : Matrix
Image
 Inheritedsource : BitmapData
[read-only]
Image
 Inherited_tint : ColorTransform
Image
 Inherited_tintFactor : Number = 1.0
Image
 Inherited_tintMode : Number = 0.0
Image
Public Methods
 MethodDefined By
  
TiledSpritemap(source:*, frameWidth:uint = 0, frameHeight:uint = 0, width:uint = 0, height:uint = 0, callback:Function = null)
Constructs the tiled spritemap.
TiledSpritemap
 Inherited
add(name:String, frames:Array, frameRate:Number = 0, loop:Boolean = true):Anim
Add an Animation.
Spritemap
 Inherited
centerOO():void
Centers the Image's originX/Y to its center.
Image
 Inherited
Centers the Image's originX/Y to its center.
Image
 Inherited
clear():void
Clears the image buffer.
Image
 Inherited
createCircle(radius:uint, color:uint = 0xFFFFFF, alpha:Number = 1):Image
[static] Creates a new circle Image.
Image
 Inherited
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
 Inherited
createRect(width:uint, height:uint, color:uint = 0xFFFFFF, alpha:Number = 1):Image
[static] Creates a new rectangle Image.
Image
 Inherited
getFrame(column:uint = 0, row:uint = 0):uint
Gets the frame index based on the column and row of the source image.
Spritemap
 Inherited
lock():void
Lock the image, preventing updateBuffer() from being run until unlock() is called, for performance.
Image
 Inherited
play(name:String, reset:Boolean = false, frame:int = 0):Anim
Plays an animation.
Spritemap
 Inherited
randFrame():void
Assigns the Spritemap to a random frame.
Spritemap
 Inherited
render(target:BitmapData, point:Point, camera:Point):void
Renders the graphic to the screen buffer.
Graphic
 Inherited
setAnimFrame(name:String, index:int):void
Sets the frame to the frame index of an animation.
Spritemap
 Inherited
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
 Inherited
unlock():void
Unlock the image.
Image
 Inherited
update():void
Updates the graphic.
Graphic
 Inherited
updateBuffer(clearBefore:Boolean = false):void
[override] Updates the spritemap's buffer.
Spritemap
Protected Methods
 MethodDefined By
 Inherited
Updates the color transform
Image
Public Constants
 ConstantDefined By
 InheritedTINTING_COLORIZE : Number = 1.0
[static] tintMode value to tint in colorize mode.
Image
 InheritedTINTING_MULTIPLY : Number = 0.0
[static] tintMode value to tint in multiply mode.
Image
Property Detail
offsetXproperty
offsetX:Number

The x-offset of the texture.


Implementation
    public function get offsetX():Number
    public function set offsetX(value:Number):void
offsetYproperty 
offsetY:Number

The y-offset of the texture.


Implementation
    public function get offsetY():Number
    public function set offsetY(value:Number):void
Constructor Detail
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.

Parameters
source:* — 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.
Method Detail
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.