Options
Menu

Class VertexAnimator

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

Hierarchy

  • AnimatorBase

Implements

  • IAsset
  • IAssetAdapter
  • IAnimator

Index

Constructors

constructor

  • Creates a new VertexAnimator object.

    Parameters

    • vertexAnimationSet: VertexAnimationSet

      The animation data set containing the vertex animations used by the animator.

    Returns VertexAnimator

Properties

_adapter

_adapter: IAssetAdapter

_pAbsoluteTime

_pAbsoluteTime: number

_pActiveAnimationName

_pActiveAnimationName: string

_pActiveNode

_pActiveNode: AnimationNodeBase

_pActiveState

_pActiveState: IAnimationState

_pAnimationSet

_pAnimationSet: IAnimationSet

_pOwners

_pOwners: Array<IEntity>

absoluteTime

absoluteTime: number

Returns the internal absolute time of the animator, calculated by the current time and the playback speed.

see

#time

see

#playbackSpeed

activeAnimation

activeAnimation: AnimationNodeBase

Returns the current active animation node.

activeAnimationName

activeAnimationName: string

Returns the current active animation node.

activeState

activeState: IAnimationState

Returns the current active animation state.

adaptee

adaptee: AssetBase

adapter

adapter: IAssetAdapter

adapter is used to provide MovieClip to scripts taken from different platforms setter typically managed by factory. getter defaults to AwayJS class

animationSet

animationSet: IAnimationSet

Returns the animation data set in use by the animator.

assetFullPath

assetFullPath: Array<string>

assetNamespace

assetNamespace: string

assetType

assetType: string
inheritdoc

autoUpdate

autoUpdate: boolean

Determines whether the animators internal update mechanisms are active. Used in cases where manual updates are required either via the time property or update() method. Defaults to true.

see

#time

see

#update()

id

id: number

A unique id for the asset, used to identify assets in an associative array

name

name: string

originalName

originalName: string

The original name used for this asset in the resource (e.g. file) in which it was found. This may not be the same as name, which may have changed due to of a name conflict.

playbackSpeed

playbackSpeed: number

The amount by which passed time should be scaled. Used to slow down or speed up animations. Defaults to 1.

time

time: number

Gets and sets the internal time clock of the animator.

updatePosition

updatePosition: boolean

Enables translation of the animated graphics from data returned per frame via the positionDelta property of the active animation node. Defaults to true.

see

away.animators.IAnimationState#positionDelta

Static DEFAULT_NAMESPACE

DEFAULT_NAMESPACE: string

Static ID_COUNT

ID_COUNT: number

Static assetType

assetType: string

Methods

_pUpdateDeltaTime

  • _pUpdateDeltaTime(dt: number): void
  • inheritdoc

    Parameters

    • dt: number

    Returns void

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

Private addOwner

  • addOwner(entity: IEntity): void
  • Used by the graphics object to which the animator is applied, registers the owner for internal use.

    Parameters

    • entity: IEntity

    Returns void

assetPathEquals

  • assetPathEquals(name: string, ns: string): boolean
  • Parameters

    • name: string
    • ns: string

    Returns boolean

clear

  • clear(): void
  • Returns void

clone

  • clone(): AnimatorBase
  • inheritdoc

    Returns AnimatorBase

Private dispatchCycleEvent

  • dispatchCycleEvent(): void
  • for internal use.

    Returns void

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

getAnimationState

  • getAnimationState(node: AnimationNodeBase): IAnimationState
  • Parameters

    • node: AnimationNodeBase

    Returns IAnimationState

getAnimationStateByName

  • getAnimationStateByName(name: string): IAnimationState
  • Parameters

    • name: string

    Returns IAnimationState

getRenderableElements

  • getRenderableElements(renderable: GL_ShapeRenderable, sourceElements: TriangleElements): TriangleElements
  • Parameters

    • renderable: GL_ShapeRenderable
    • sourceElements: TriangleElements

    Returns TriangleElements

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

invalidate

  • invalidate(): void
  • Returns void

invalidateElements

  • invalidateElements(): void
  • Returns void

isAsset

  • isAsset(assetClass: IAssetClass): boolean
  • Parameters

    • assetClass: IAssetClass

    Returns boolean

phase

  • phase(value: number): void
  • Sets the animation phase of the current active state's animation clip(s).

    Parameters

    • value: number

      The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end.

    Returns void

play

  • Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame.

    Parameters

    • name: string
    • Default value transition: IAnimationTransition = null
    • Default value offset: number = NaN

    Returns void

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

Private removeOwner

  • removeOwner(entity: IEntity): void
  • Used by the graphics object from which the animator is removed, unregisters the owner for internal use.

    Parameters

    • entity: IEntity

    Returns void

reset

  • reset(name: string, offset?: number): void
  • Parameters

    • name: string
    • Optional offset: number

    Returns void

resetAssetPath

  • resetAssetPath(name: string, ns?: string, overrideOriginal?: boolean): void
  • Parameters

    • name: string
    • Optional ns: string
    • Optional overrideOriginal: boolean

    Returns void

setRenderState

  • setRenderState(shader: ShaderBase, renderable: GL_ShapeRenderable, stage: Stage, projection: ProjectionBase): void
  • inheritdoc

    Parameters

    • shader: ShaderBase
    • renderable: GL_ShapeRenderable
    • stage: Stage
    • projection: ProjectionBase

    Returns void

start

  • start(): void
  • Resumes the automatic playback clock controling the active state of the animator.

    Returns void

stop

  • stop(): void
  • Pauses the automatic playback clock of the animator, in case manual updates are required via the time property or update() method.

    see

    #time

    see

    #update()

    Returns void

testGPUCompatibility

  • testGPUCompatibility(shader: ShaderBase): void
  • Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu. Needs to be called if gpu code is potentially required.

    Parameters

    • shader: ShaderBase

    Returns void

update

  • update(time: number): void
  • Provides a way to manually update the active state of the animator when automatic updates are disabled.

    see

    #stop()

    see

    #autoUpdate

    Parameters

    • time: number

    Returns void

updateFullPath

  • updateFullPath(): void
  • Returns void

Generated using TypeDoc