Options
Menu

Class ParticleColorNode

A particle animation node used to control the color variation of a particle over time.

Hierarchy

Implements

  • IAsset
  • IAssetAdapter

Index

Constructors

constructor

  • new ParticleColorNode(mode: number, usesMultiplier?: boolean, usesOffset?: boolean, usesCycle?: boolean, usesPhase?: boolean, startColor?: ColorTransform, endColor?: ColorTransform, cycleDuration?: number, cyclePhase?: number): ParticleColorNode
  • Creates a new ParticleColorNode

    Parameters

    • mode: number

      Defines whether the mode of operation acts on local properties of a particle or global properties of the node.

    • Default value usesMultiplier: boolean = true

      Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true.

    • Default value usesOffset: boolean = true

      Defines whether the node uses offset data in the shader for its color transformations. Defaults to true.

    • Default value usesCycle: boolean = false

      Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false.

    • Default value usesPhase: boolean = false

      Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false.

    • Default value startColor: ColorTransform = null

      Defines the default start color transform of the node, when in global mode.

    • Default value endColor: ColorTransform = null

      Defines the default end color transform of the node, when in global mode.

    • Default value cycleDuration: number = 1

      Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.

    • Default value cyclePhase: number = 0

      Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.

    Returns ParticleColorNode

Properties

_adapter

_adapter: IAssetAdapter

Private _iCycleDuration

_iCycleDuration: number

Private _iCyclePhase

_iCyclePhase: number

_iDataOffset

_iDataOffset: number

Private _iEndColor

_iEndColor: ColorTransform

Private _iStartColor

_iStartColor: ColorTransform

Private _iUsesCycle

_iUsesCycle: boolean

Private _iUsesMultiplier

_iUsesMultiplier: boolean

Private _iUsesOffset

_iUsesOffset: boolean

Private _iUsesPhase

_iUsesPhase: boolean

_pDataLength

_pDataLength: number

_pMode

_pMode: number

_pOneData

_pOneData: Array<number>

_pStateClass

_pStateClass: any

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

assetType

assetType: string
inheritdoc

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.

stateClass

stateClass: any

Static COLOR_END_COLORTRANSFORM

COLOR_END_COLORTRANSFORM: string

Reference for color node properties on a single particle (when in local property mode). Expects a ColorTransform object representing the end color transform applied to the particle.

Static COLOR_START_COLORTRANSFORM

COLOR_START_COLORTRANSFORM: string

Reference for color node properties on a single particle (when in local property mode). Expects a ColorTransform object representing the start color transform applied to the particle.

Static DEFAULT_NAMESPACE

DEFAULT_NAMESPACE: string

Static ID_COUNT

ID_COUNT: number

Static assetType

assetType: string

Accessors

dataLength

  • get (): number
  • Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set.

    see

    away.animators.ParticleAnimationSet

    see

    #getAGALVertexCode

    Returns number

mode

  • get (): number
  • Returns the property mode of the particle animation node. Typically set in the node constructor

    see

    away.animators.ParticlePropertiesMode

    Returns number

oneData

  • get (): Array<number>
  • Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set.

    see

    away.animators.ParticleAnimationSet

    see

    #generatePropertyOfOneParticle

    Returns Array<number>

priority

  • get (): number
  • Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation.

    see

    away.animators.ParticleAnimationSet

    see

    #getAGALVertexCode

    Returns number

Methods

_iGeneratePropertyOfOneParticle

_iProcessAnimationSetting

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

assetPathEquals

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

    • name: string
    • ns: string

    Returns boolean

clear

  • clear(): void
  • Returns void

dispatchEvent

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

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

getAGALFragmentCode

  • getAGALFragmentCode(shader: ShaderBase, animationSet: ParticleAnimationSet, registerCache: ShaderRegisterCache, animationRegisterData: AnimationRegisterData): string
  • Returns the AGAL code of the particle animation node for use in the fragment shader.

    Parameters

    • shader: ShaderBase
    • animationSet: ParticleAnimationSet
    • registerCache: ShaderRegisterCache
    • animationRegisterData: AnimationRegisterData

    Returns string

getAGALUVCode

  • getAGALUVCode(shader: ShaderBase, animationSet: ParticleAnimationSet, registerCache: ShaderRegisterCache, animationRegisterData: AnimationRegisterData): string
  • Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required.

    Parameters

    • shader: ShaderBase
    • animationSet: ParticleAnimationSet
    • registerCache: ShaderRegisterCache
    • animationRegisterData: AnimationRegisterData

    Returns string

getAGALVertexCode

  • getAGALVertexCode(shader: ShaderBase, animationSet: ParticleAnimationSet, registerCache: ShaderRegisterCache, animationRegisterData: AnimationRegisterData): string
  • inheritdoc

    Parameters

    • shader: ShaderBase
    • animationSet: ParticleAnimationSet
    • registerCache: ShaderRegisterCache
    • animationRegisterData: AnimationRegisterData

    Returns string

getAnimationState

  • inheritdoc

    Parameters

    • animator: AnimatorBase

    Returns ParticleColorState

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

isAsset

  • isAsset(assetClass: IAssetClass): boolean
  • Parameters

    • assetClass: IAssetClass

    Returns boolean

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

resetAssetPath

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

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

    Returns void

updateFullPath

  • updateFullPath(): void
  • Returns void

Generated using TypeDoc