three-nebula API
    Preparing search index...

    Class Alpha

    Behaviour that applies an alpha transition effect to particles.

    Hierarchy (View Summary)

    Index
    • Constructs an Alpha behaviour instance.

      Parameters

      • alphaA: number = 1

        The starting alpha value

      • alphaB: number | null = null

        The ending alpha value

      • Optionallife: number

        The life of the behaviour

      • Optionaleasing: EasingFunction

        The easing equation to use for transforms

      • isEnabled: boolean = true

        Determines if the behaviour will be applied or not

      Returns Alpha

    _life: number
    _same: boolean
    age: number
    alphaA: Span<number>
    alphaB: Span<number>
    dead: boolean
    energy: number
    id: string
    isEnabled: boolean
    type: string
    • get life(): number

      Gets the behaviour's life.

      Returns number

    • set life(life: number): void

      Ensures that life is infinity if an invalid value is supplied.

      Parameters

      • life: number

      Returns void

    • get same(): boolean

      Gets the _same property which determines if the alpha are the same.

      Returns boolean

    • set same(same: boolean): void

      Sets the _same property which determines if the alpha are the same.

      Parameters

      • same: boolean

      Returns void

    • Compares the age of the behaviour vs integration time and determines if the behaviour should be set to dead or not.

      Parameters

      • particle: Particle
      • time: number
      • Optionalindex: number

      Returns void

    • Returns a new instance of the behaviour from the JSON object passed.

      Parameters

      • json: Record<string, unknown>

      Returns void

    • Mutates the target's alpha/opacity property.

      Parameters

      • particle: Particle

        the particle to apply the behaviour to

      • time: number

        engine time

      • Optionalindex: number

        the particle index

      Returns void

    • Resets the behaviour properties.

      Parameters

      • alphaA: number = 1

        the starting alpha value

      • alphaB: number | null = null

        the ending alpha value

      • Optionallife: number

        the life of the behaviour

      • Optionaleasing: EasingFunction

        the easing equation to use for transforms

      Returns void

    • Creates a Body initializer from JSON.

      Parameters

      • json: AlphaJSON

        The JSON to construct the instance from.

      Returns Alpha