Packagevegas.display
Classpublic class SpriteSheet
InheritanceSpriteSheet Inheritance Object

A sprite sheet is a bitmapdata containing multiple images. This is useful for simple forms of sprite animation where the program cycles between different images from the sprite sheet.



Public Properties
 PropertyDefined By
  area : Rectangle
Optional Rectangle reference to defines in the bitmapdata the spritesheet area.
SpriteSheet
  bitmapData : BitmapData
[read-only] The internal BitmapData reference of this SpriteSheet.
SpriteSheet
  tileHeight : uint
[read-only] Indicates the height in pixels of the tiles in the sprite sheet.
SpriteSheet
  tileWidth : uint
[read-only] Indicates the width in pixels of the tiles in the sprite sheet.
SpriteSheet
Public Methods
 MethodDefined By
  
SpriteSheet(bitmapData:BitmapData, tileWidth:Number = 0, tileHeight:Number = 0, area:Rectangle = null)
Creates a new SpriteSheet instance.
SpriteSheet
  
dispose():void
Dispose the SpriteSheet before delete it.
SpriteSheet
  
getSpriteAt(index:int):BitmapData
Returns the sprite representation (BitmapData) at the specified index in the sprite sheet.
SpriteSheet
Property Detail
areaproperty
area:Rectangle

Optional Rectangle reference to defines in the bitmapdata the spritesheet area. If this argument is null all the bitmapdata is used.


Implementation
    public function get area():Rectangle
    public function set area(value:Rectangle):void
bitmapDataproperty 
bitmapData:BitmapData  [read-only]

The internal BitmapData reference of this SpriteSheet.


Implementation
    public function get bitmapData():BitmapData
tileHeightproperty 
tileHeight:uint  [read-only]

Indicates the height in pixels of the tiles in the sprite sheet.


Implementation
    public function get tileHeight():uint
tileWidthproperty 
tileWidth:uint  [read-only]

Indicates the width in pixels of the tiles in the sprite sheet.


Implementation
    public function get tileWidth():uint
Constructor Detail
SpriteSheet()Constructor
public function SpriteSheet(bitmapData:BitmapData, tileWidth:Number = 0, tileHeight:Number = 0, area:Rectangle = null)

Creates a new SpriteSheet instance.

Parameters
bitmapData:BitmapData — The BitmapData reference to create the sprite sheet.
 
tileWidth:Number (default = 0) — The width of the tiles in the sprite sheet.
 
tileHeight:Number (default = 0) — The height of the tiles in the sprite sheet.
 
area:Rectangle (default = null) — Optional Rectangle to defines in the bitmapdata the spritesheet area. If this argument is null all the bitmapdata is used.
Method Detail
dispose()method
public function dispose():void

Dispose the SpriteSheet before delete it.

getSpriteAt()method 
public function getSpriteAt(index:int):BitmapData

Returns the sprite representation (BitmapData) at the specified index in the sprite sheet.

Parameters

index:int

Returns
BitmapData — the sprite representation (BitmapData) at the specified index in the sprite sheet.