| Package | com.pblabs.rendering2D |
| Class | public class MovieClipRenderer |
| Inheritance | MovieClipRenderer DisplayObjectRenderer AnimatedComponent EntityComponent Object |
It can be used one of two ways. You can either subclass it and override getClipInstance(), or you create one and set the clip property.
| Property | Defined By | ||
|---|---|---|---|
![]() | alpha : Number
Transparency, 0 being completely transparent and 1 being opaque. | DisplayObjectRenderer | |
![]() | alphaProperty : PropertyReference
If set, alpha is gotten from this property every frame. | DisplayObjectRenderer | |
![]() | blendMode : String
Blend mode, using strings from flash.display.BlendMode
| DisplayObjectRenderer | |
![]() | blendModeProperty : PropertyReference
If set, blend mode is gotten from this property every frame. | DisplayObjectRenderer | |
| clip : MovieClip | MovieClipRenderer | ||
| destroyOnEnd : Boolean = false
Should we destroy the entity when animation is over? Useful for
things like explosions. | MovieClipRenderer | ||
![]() | displayObject : DisplayObject
The displayObject which this DisplayObjectRenderer will draw. | DisplayObjectRenderer | |
| failed : Boolean [read-only]
Indicates if the SWFResource has failed loading
| MovieClipRenderer | ||
| fileName : String
Resource (file)name of the SWFResource
| MovieClipRenderer | ||
| frameRate : Number = 25
Framerate for playback. | MovieClipRenderer | ||
![]() | isRegistered : Boolean [read-only]
Whether or not the component is currently registered with an entity. | EntityComponent | |
![]() | layerIndex : int
In what layer of the scene is this renderer drawn?
| DisplayObjectRenderer | |
![]() | layerIndexProperty : PropertyReference
If set, the layer index is gotten from this property every frame. | DisplayObjectRenderer | |
| loaded : Boolean [read-only]
Indicates if the SWFResource has been loaded
| MovieClipRenderer | ||
| loading : Boolean [read-only]
Indicates if the resource is beeing loaded
| MovieClipRenderer | ||
![]() | localBounds : Rectangle [read-only]
| DisplayObjectRenderer | |
| loop : Boolean = false
Should we loop the animation?
| MovieClipRenderer | ||
![]() | name : String [read-only]
The name given to the component when it is added to an entity. | EntityComponent | |
![]() | objectMask : ObjectType
The types for this object; used for picking queries primarily. | DisplayObjectRenderer | |
![]() | owner : IEntity
A reference to the entity that this component currently belongs to. | EntityComponent | |
![]() | position : Point
Position of the renderer in scene space. | DisplayObjectRenderer | |
![]() | positionOffset : Point
Sets a position offset that will offset the sprite. | DisplayObjectRenderer | |
![]() | positionProperty : PropertyReference
If set, position is gotten from this property every frame. | DisplayObjectRenderer | |
![]() | registerForUpdates : Boolean
Set to register/unregister for frame updates. | AnimatedComponent | |
![]() | registrationPoint : Point
The registration point can be used to offset the sprite
so that rotation and scaling work properly. | DisplayObjectRenderer | |
![]() | registrationPointProperty : PropertyReference
If set, our registration point is gotten from this property every frame. | DisplayObjectRenderer | |
![]() | renderKey : int = 0
Reference value used for sorting in some scenes. | DisplayObjectRenderer | |
![]() | renderPosition : Point [read-only]
Where in the scene will this object be rendered?
| DisplayObjectRenderer | |
| resource : SWFResource [read-only]
Loaded SWFResource
| MovieClipRenderer | ||
![]() | rotation : Number
Rotation in degrees, with 0 being Y+. | DisplayObjectRenderer | |
![]() | rotationOffset : Number
Rotation offset applied to the child DisplayObject. | DisplayObjectRenderer | |
![]() | rotationProperty : PropertyReference
If set, rotation is gotten from this property every frame. | DisplayObjectRenderer | |
![]() | scale : Point
You can scale things on the X and Y axes. | DisplayObjectRenderer | |
![]() | scaleProperty : PropertyReference
If set, scale is gotten from this property every frame. | DisplayObjectRenderer | |
![]() | scene : IScene2D
The scene which is responsible for drawing this renderer. | DisplayObjectRenderer | |
![]() | sceneBounds : Rectangle [read-only]
Our bounds in scene coordinates. | DisplayObjectRenderer | |
![]() | size : Point
Explicitly set the size. | DisplayObjectRenderer | |
![]() | sizeProperty : PropertyReference
If set, size is determined by this property every frame. | DisplayObjectRenderer | |
![]() | snapToNearestPixels : Boolean = true
if set this to false, positions will be handeled with numbers insteed of integers
makes slow movement smoother for example
| DisplayObjectRenderer | |
![]() | updatePriority : Number = 0.0
The update priority for this component. | AnimatedComponent | |
![]() | worldPosition : Point
Convenience method to allow placing the renderer in world coordinates. | DisplayObjectRenderer | |
![]() | x : Number
The x value of our scene space position. | DisplayObjectRenderer | |
![]() | y : Number
The y component of our scene space position. | DisplayObjectRenderer | |
![]() | zIndex : int
By default, layers are sorted based on the z-index, from small
to large. | DisplayObjectRenderer | |
![]() | zIndexProperty : PropertyReference
If set, our z-index is gotten from this property every frame. | DisplayObjectRenderer | |
| Method | Defined By | ||
|---|---|---|---|
onFrame(elapsed:Number):void [override] | MovieClipRenderer | ||
![]() | pointOccupied(worldPosition:Point, mask:ObjectType):Boolean
Is the rendered object opaque at the request position in screen space?
| DisplayObjectRenderer | |
![]() |
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 | |
![]() | transformObjectToWorld(p:Point):Point
Transform a point from object space to world space. | DisplayObjectRenderer | |
![]() | transformWorldToObject(p:Point):Point
Transform a point from world space to object space. | DisplayObjectRenderer | |
![]() | unregister():void
Unregisters the component from an entity. | EntityComponent | |
![]() | updateTransform(updateProps:Boolean = false):void
Update the object's transform based on its current state. | DisplayObjectRenderer | |
| Method | Defined By | ||
|---|---|---|---|
![]() | addToScene():void | DisplayObjectRenderer | |
findMaxFrames(parent:MovieClip, currentMax:int):int
Find the child clip with the largest number of frames. | MovieClipRenderer | ||
getClipInstance():MovieClip | MovieClipRenderer | ||
![]() | onAdd():void [override] | DisplayObjectRenderer | |
![]() | onRemove():void [override] | DisplayObjectRenderer | |
![]() | onReset():void
This is called anytime a component is added or removed from the owner entity. | EntityComponent | |
![]() | removeFromScene():void | DisplayObjectRenderer | |
updateChildClips(parent:MovieClip, currentFrame:int):void
Recursively advance a clip's children to the current frame. | MovieClipRenderer | ||
![]() | updateProperties():void | DisplayObjectRenderer | |
| _clipDirty | property |
protected var _clipDirty:Boolean = true| _clipFrame | property |
protected var _clipFrame:int| _clipLastUpdate | property |
protected var _clipLastUpdate:Number| _maxFrames | property |
protected var _maxFrames:int| clip | property |
clip:MovieClip public function get clip():MovieClip public function set clip(value:MovieClip):void| destroyOnEnd | property |
public var destroyOnEnd:Boolean = falseShould we destroy the entity when animation is over? Useful for things like explosions.
| failed | property |
failed:Boolean [read-only] Indicates if the SWFResource has failed loading
public function get failed():Boolean| fileName | property |
fileName:StringResource (file)name of the SWFResource
public function get fileName():String public function set fileName(value:String):void| frameRate | property |
public var frameRate:Number = 25Framerate for playback.
| loaded | property |
loaded:Boolean [read-only] Indicates if the SWFResource has been loaded
public function get loaded():Boolean| loading | property |
loading:Boolean [read-only] Indicates if the resource is beeing loaded
public function get loading():Boolean| loop | property |
public var loop:Boolean = falseShould we loop the animation?
| resource | property |
resource:SWFResource [read-only] Loaded SWFResource
public function get resource():SWFResource| findMaxFrames | () | method |
protected function findMaxFrames(parent:MovieClip, currentMax:int):intFind the child clip with the largest number of frames. This will be used as our target for the end of the animation.
Parameters
parent:MovieClip | |
currentMax:int |
int |
| getClipInstance | () | method |
protected function getClipInstance():MovieClipReturnsMovieClip |
| onFrame | () | method |
override public function onFrame(elapsed:Number):voidParameters
elapsed:Number |
| updateChildClips | () | method |
protected function updateChildClips(parent:MovieClip, currentFrame:int):voidRecursively advance a clip's children to the current frame. This takes into account children with varying frame counts.
Parameters
parent:MovieClip | |
currentFrame:int |