| Package | com.pblabs.rendering2D.spritesheet |
| Class | public class SpriteContainerComponent |
| Inheritance | SpriteContainerComponent EntityComponent Object |
| Subclasses | SpriteSheetComponent, SWFSpriteSheetComponent |
See also
| Property | Defined By | ||
|---|---|---|---|
| center : Point
Specifies an offset so the sprite is centered correctly. | SpriteContainerComponent | ||
| centered : Boolean [read-only]
Indicates that the spriteSheet has a centered alignment. | SpriteContainerComponent | ||
| degreesPerDirection : Number [read-only]
The number of degrees separating each direction. | SpriteContainerComponent | ||
| directionsPerFrame : Number = 1
The number of directions per frame. | SpriteContainerComponent | ||
| frameCount : int
The number of frames the sprite container has. | SpriteContainerComponent | ||
| isLoaded : Boolean [read-only]
True if the frames associated with this sprite container have been loaded. | SpriteContainerComponent | ||
![]() | isRegistered : Boolean [read-only]
Whether or not the component is currently registered with an entity. | EntityComponent | |
| modifiers : Array
Array with BitmapData modifiers that will be pre-rendered
| SpriteContainerComponent | ||
![]() | name : String [read-only]
The name given to the component when it is added to an entity. | EntityComponent | |
![]() | owner : IEntity
A reference to the entity that this component currently belongs to. | EntityComponent | |
| rawFrameCount : int [read-only]
The total number of frames the sprite container has. | SpriteContainerComponent | ||
| Property | Defined By | ||
|---|---|---|---|
| frames : Array = null | SpriteContainerComponent | ||
| Method | Defined By | ||
|---|---|---|---|
getFrame(index:int, direction:Number = 0.0):BitmapData
Gets the bitmap data for a frame at the specified index. | SpriteContainerComponent | ||
![]() |
Registers the component with an entity. | EntityComponent | |
![]() | reset():void
This is called by an entity on all of its components any time a component
is added or removed. | EntityComponent | |
![]() | unregister():void
Unregisters the component from an entity. | EntityComponent | |
| Method | Defined By | ||
|---|---|---|---|
buildFrames():void | SpriteContainerComponent | ||
deleteFrames():void
Deletes the frames so this class can be re-used with a new set of frames. | SpriteContainerComponent | ||
getRawFrame(index:int):BitmapData
Gets the frame at the specified index. | SpriteContainerComponent | ||
getSourceFrames():Array
Subclasses must override this method and return an
array of BitmapData objects. | SpriteContainerComponent | ||
![]() | onAdd():void
This is called when the component is added to an entity. | EntityComponent | |
![]() | onRemove():void
This is called when the component is removed from an entity. | EntityComponent | |
![]() | onReset():void
This is called anytime a component is added or removed from the owner entity. | EntityComponent | |
| center | property |
center:PointSpecifies an offset so the sprite is centered correctly. If it is not set, the sprite is centered.
public function get center():Point public function set center(value:Point):void| centered | property |
centered:Boolean [read-only] Indicates that the spriteSheet has a centered alignment.
public function get centered():Boolean| degreesPerDirection | property |
degreesPerDirection:Number [read-only] The number of degrees separating each direction.
public function get degreesPerDirection():Number| directionsPerFrame | property |
public var directionsPerFrame:Number = 1The number of directions per frame.
| frameCount | property |
frameCount:intThe number of frames the sprite container has. This counts each set of directions as one frame.
public function get frameCount():int public function set frameCount(value:int):void| frames | property |
protected var frames:Array = null| isLoaded | property |
isLoaded:Boolean [read-only] True if the frames associated with this sprite container have been loaded.
public function get isLoaded():Boolean| modifiers | property |
modifiers:ArrayArray with BitmapData modifiers that will be pre-rendered
public function get modifiers():Array public function set modifiers(value:Array):void| rawFrameCount | property |
rawFrameCount:int [read-only] The total number of frames the sprite container has. This counts each direction separately.
public function get rawFrameCount():int| buildFrames | () | method |
protected function buildFrames():void| deleteFrames | () | method |
protected function deleteFrames():voidDeletes the frames so this class can be re-used with a new set of frames.
| getFrame | () | method |
public function getFrame(index:int, direction:Number = 0.0):BitmapDataGets the bitmap data for a frame at the specified index.
Parameters
index:int — The index of the frame to retrieve.
| |
direction:Number (default = 0.0) — The direction of the frame to retrieve in degrees. This
can be ignored if there is only 1 direction per frame.
|
BitmapData — The bitmap data for the specified frame, or null if it doesn't exist.
|
| getRawFrame | () | method |
protected function getRawFrame(index:int):BitmapDataGets the frame at the specified index. This does not take direction into account.
Parameters
index:int |
BitmapData |
| getSourceFrames | () | method |
protected function getSourceFrames():ArraySubclasses must override this method and return an array of BitmapData objects.
ReturnsArray |