| Package | com.pblabs.rendering2D.spritesheet |
| Class | public class SWFSpriteSheetComponent |
| Inheritance | SWFSpriteSheetComponent SpriteContainerComponent EntityComponent Object |
| Property | Defined By | ||
|---|---|---|---|
| bounds : Rectangle [read-only]
The bounds of the source MovieClip. | SWFSpriteSheetComponent | ||
| cached : Boolean = true
When cached is set to true (the default) the rasterized frames
are re-used by all instances of the SWFSpriteSheetComponent
with the same values for swf, smoothing, and clipName. | SWFSpriteSheetComponent | ||
![]() | 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 | |
| clipName : String
The name of the clip to instantiate from the SWF. | SWFSpriteSheetComponent | ||
![]() | 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 [override] [read-only] | SWFSpriteSheetComponent | ||
![]() | 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 | |
| scale : Point
X/Y scaling for the SWF as it renders to bitmap. | SWFSpriteSheetComponent | ||
| smoothing : Boolean
Whether or not the bitmaps that are drawn should be smoothed. | SWFSpriteSheetComponent | ||
| swf : SWFResource
The SWF to be rasterized into frames. | SWFSpriteSheetComponent | ||
| Property | Defined By | ||
|---|---|---|---|
| _frameCache : Dictionary [static] | SWFSpriteSheetComponent | ||
![]() | frames : Array = null | SpriteContainerComponent | |
| 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 | |
getBitmapDataByDisplay(display:DisplayObject):BitmapData
Draws the DisplayObject to a BitmapData using the bounds of the object. | SWFSpriteSheetComponent | ||
getCachedFrames():CachedFramesData
Reads the frames from the cache. | SWFSpriteSheetComponent | ||
getFramesCacheKey():String | SWFSpriteSheetComponent | ||
getRawFrame(index:int):BitmapData [override] | SWFSpriteSheetComponent | ||
getSourceFrames():Array [override]
Rasterizes the associated MovieClip and returns a list of frames. | SWFSpriteSheetComponent | ||
![]() | onAdd():void
This is called when the component is added to an entity. | EntityComponent | |
onRasterize(mc:MovieClip):Array
Performs the actual rasterizing. | SWFSpriteSheetComponent | ||
![]() | 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 | |
rasterize():void
Rasterizes the clip into an Array of BitmapData objects. | SWFSpriteSheetComponent | ||
rasterizeFrame(mc:MovieClip, frameIndex:int):BitmapData | SWFSpriteSheetComponent | ||
setCachedFrames(frames:CachedFramesData):void
Caches the frames based on the current values. | SWFSpriteSheetComponent | ||
| _frameCache | property |
protected static var _frameCache:Dictionary| bounds | property |
bounds:Rectangle [read-only] The bounds of the source MovieClip. This can be used for clips that are expected to be rendered based on their bounds.
public function get bounds():Rectangle| cached | property |
public var cached:Boolean = trueWhen cached is set to true (the default) the rasterized frames are re-used by all instances of the SWFSpriteSheetComponent with the same values for swf, smoothing, and clipName.
| clipName | property |
clipName:StringThe name of the clip to instantiate from the SWF. If this is null the root clip will be used.
public function get clipName():String public function set clipName(value:String):void| isLoaded | property |
isLoaded:Boolean [read-only] [override] public function get isLoaded():Boolean| scale | property |
scale:PointX/Y scaling for the SWF as it renders to bitmap. Value of (1, 1) mean no scaling (default). (0.5, 0.5) would be half the normal size, and (2, 2) would be double.
public function get scale():Point public function set scale(value:Point):void| smoothing | property |
smoothing:BooleanWhether or not the bitmaps that are drawn should be smoothed. Default is True.
public function get smoothing():Boolean public function set smoothing(value:Boolean):void| swf | property |
swf:SWFResourceThe SWF to be rasterized into frames.
public function get swf():SWFResource public function set swf(value:SWFResource):void| getBitmapDataByDisplay | () | method |
protected function getBitmapDataByDisplay(display:DisplayObject):BitmapDataDraws the DisplayObject to a BitmapData using the bounds of the object.
Parameters
display:DisplayObject |
BitmapData |
| getCachedFrames | () | method |
protected function getCachedFrames():CachedFramesDataReads the frames from the cache. Returns a null reference if they are not cached.
ReturnsCachedFramesData |
| getFramesCacheKey | () | method |
protected function getFramesCacheKey():StringReturnsString |
| getRawFrame | () | method |
override protected function getRawFrame(index:int):BitmapDataParameters
index:int |
BitmapData |
| getSourceFrames | () | method |
override protected function getSourceFrames():ArrayRasterizes the associated MovieClip and returns a list of frames.
ReturnsArray |
| onRasterize | () | method |
protected function onRasterize(mc:MovieClip):ArrayPerforms the actual rasterizing. Override this to perform custom rasterizing of a clip.
Parameters
mc:MovieClip |
Array |
| rasterize | () | method |
protected function rasterize():voidRasterizes the clip into an Array of BitmapData objects. This array can then be used just like a sprite sheet.
| rasterizeFrame | () | method |
protected function rasterizeFrame(mc:MovieClip, frameIndex:int):BitmapDataParameters
mc:MovieClip | |
frameIndex:int |
BitmapData |
| setCachedFrames | () | method |
protected function setCachedFrames(frames:CachedFramesData):voidCaches the frames based on the current values.
Parameters
frames:CachedFramesData |