Options
Menu

Class AnimatorBase

Provides an abstract base class for animator classes that control animation output from a data set subtype of AnimationSetBase.

see

away.animators.AnimationSetBase

Hierarchy

  • AssetBase

Implements

  • IAsset
  • IAssetAdapter
  • IAnimator

Index

Constructors

constructor

  • new AnimatorBase(animationSet: IAnimationSet): AnimatorBase
  • Creates a new AnimatorBase object.

    Parameters

    • animationSet: IAnimationSet

      The animation data set to be used by the animator object.

    Returns AnimatorBase

Properties

_adapter

_adapter: IAssetAdapter

_pAbsoluteTime

_pAbsoluteTime: number

_pActiveAnimationName

_pActiveAnimationName: string

_pActiveNode

_pActiveNode: AnimationNodeBase

_pActiveState

_pActiveState: IAnimationState

_pAnimationSet

_pAnimationSet: IAnimationSet

_pOwners

_pOwners: Array<IEntity>

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

assetFullPath

assetFullPath: Array<string>

assetNamespace

assetNamespace: string

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.

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

Accessors

absoluteTime

  • get (): number
  • Returns the internal absolute time of the animator, calculated by the current time and the playback speed.

    see

    #time

    see

    #playbackSpeed

    Returns number

activeAnimation

  • get (): AnimationNodeBase
  • Returns the current active animation node.

    Returns AnimationNodeBase

activeAnimationName

  • get (): string
  • Returns the current active animation node.

    Returns string

activeState

  • Returns the current active animation state.

    Returns IAnimationState

animationSet

  • get (): IAnimationSet
  • Returns the animation data set in use by the animator.

    Returns IAnimationSet

assetType

  • get (): string
  • inheritdoc

    Returns string

autoUpdate

  • get (): boolean
  • set (value: boolean): void
  • 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()

    Returns 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.

    Parameters

    • value: boolean

    Returns void

playbackSpeed

  • get (): number
  • set (value: number): void
  • The amount by which passed time should be scaled. Used to slow down or speed up animations. Defaults to 1.

    Returns number

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

    Parameters

    • value: number

    Returns void

time

  • get (): number
  • set (value: number): void
  • Gets and sets the internal time clock of the animator.

    Returns number

  • Gets and sets the internal time clock of the animator.

    Parameters

    • value: number

    Returns void

Methods

Private _pUpdateDeltaTime

  • _pUpdateDeltaTime(dt: number): void
  • Internal abstract method called when the time delta property of the animator's contents requires updating.

    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

  • 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

  • Parameters

    • node: AnimationNodeBase

    Returns IAnimationState

getAnimationStateByName

  • Parameters

    • name: string

    Returns IAnimationState

getRenderableElements

  • getRenderableElements(renderable: GL_RenderableBase, sourceElements: ElementsBase): ElementsBase
  • Parameters

    Returns ElementsBase

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

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
    • Default value offset: number = 0

    Returns void

resetAssetPath

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

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

    Returns void

setRenderState

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

  • inheritdoc

    Parameters

    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