Provides an interface for assigning uv-based sprite sheet animation data sets to mesh-based entity objects and controlling the various available states of animation through an interative playhead that can be automatically updated or manually triggered.


Inherited from AnimatorBase -> NamedAssetBase -> EventDispatcher.



Can be created with method new:

Lib.Away3D.Animators.SpriteSheetAnimator.new(spriteSheetAnimationSet)

Creates a new SpriteSheetAnimator object.

spriteSheetAnimationSet - The animation data set containing the sprite sheet animation states used by the animator. (SpriteSheetAnimationSet)


Has properties:

fps

Int, Set the playrate of the animation in frames per second (not depending on player fps

reverse

True/False, If true, reverse causes the animation to play backwards

backAndForth

True/False, If true, backAndForth causes the animation to play backwards and forward alternatively. Starting forward.

currentFrameNumber

[read-only] Int, returns the current frame

totalFrames

[read-only] Int, returns the total amount of frame for the current animation


Created SpriteSheetAnimator object has methods:

clone()

Returns a shallow clone (re-using the same IAnimationSet) of this IAnimator.

SpriteSheetAnimator


setRenderState(stage3DProxy, renderable, vertexConstantOffset, vertexStreamOffset, camera)

Sets the GPU render state required by the animation that is dependent of the rendered object.

stage3DProxy - The Stage3DProxy object which is currently being used for rendering.

renderable - The object currently being rendered. SegmentSet, SkyBox, Sprite3D, SubMesh

vertexConstantOffset - The first available vertex register to write data to if running on the gpu. Int.

vertexStreamOffset - The first available vertex stream to write vertex data to if running on the gpu. Int.

camera - Camera3D object

play(name, transition, offset)

Plays an animation state registered with the given name in the animation data set.

name - The data set name of the animation state to be played.

transition - Transition object that determines how the animator will transition from the currently active animation state. Default nil. (Has no implementation yet, use nil)

offset - Offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states.

Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation