Home Reference Source
public class | source

Alpha

Extends:

Behaviour → Alpha

Behaviour that applies an alpha transition effect to particles.

Static Method Summary

Static Public Methods
public static

fromJSON(json: object): Body

Creates a Body initializer from JSON.

Constructor Summary

Public Constructor
public

constructor(alphaA: number, alphaB: number, life: number, easing: function, isEnabled: boolean): *

Constructs an Alpha behaviour instance.

Member Summary

Public Members
public

The starting alpha value

public

The ending alpha value

public get

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

public set

same(same: boolean): boolean

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

Private Members
private

Method Summary

Public Methods
public

initialize(particle: object): *

Initializes the behaviour on a particle.

public

mutate(particle: object, time: number, index: integer): *

Mutates the target's alpha/opacity property.

public

reset(alphaA: number, alphaB: number, life: number, easing: function): *

Resets the behaviour properties.

Inherited Summary

From class Behaviour
public get

life: Number: *

Gets the behaviour's life.

public set

life: *

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

public

The age of the behaviour

public

Determines if the behaviour is dead or not

public

The behaviour's decaying trend

public

The energy of the behaviour

public

The behaviour's id

public

Determines if the behaviour will be applied or not

public

The class type.

private

_life: *

public abstract

applyBehaviour(target: Particle | Emitter, time: Number, index: integer): *

Apply behaviour to the target as a factor of time.

public abstract

Destory this behaviour.

public

energize(particle: Particle, time: Number): *

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

public abstract

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

public abstract

initialize(particle: Particle)

Set the behaviour's initial properties on the particle.

public abstract

mutate(target: Particle | Emitter, time: Number): *

Change the target's properties according to specific behaviour logic.

public

Normalize a force by 1:100;

public

Normalize a value by 1:100;

public

reset(life: number, easing: function)

Reset this behaviour's parameters

Static Public Methods

public static fromJSON(json: object): Body source

Creates a Body initializer from JSON.

Override:

Behaviour#fromJSON

Params:

NameTypeAttributeDescription
json object

The JSON to construct the instance from.

Return:

Body

Return Properties:

NameTypeAttributeDescription
json.alphaA number

The starting alpha value

json.alphaB number

The ending alpha value

json.life number

The life of the behaviour

json.easing string

The easing equation to use for transforms

Public Constructors

public constructor(alphaA: number, alphaB: number, life: number, easing: function, isEnabled: boolean): * source

Constructs an Alpha behaviour instance.

Override:

Behaviour#constructor

Params:

NameTypeAttributeDescription
alphaA number

The starting alpha value

alphaB number
  • nullable: true

The ending alpha value

life number

The life of the behaviour

easing function

The easing equation to use for transforms

isEnabled boolean
  • optional
  • default: true

Determines if the behaviour will be applied or not

Return:

*

void

Public Members

public alphaA: number | Span source

The starting alpha value

public alphaB: number | Span source

The ending alpha value

public get same: boolean: * source

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

Return:

boolean

public set same(same: boolean): boolean source

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

Return:

boolean

Private Members

private _same: boolean source

Public Methods

public initialize(particle: object): * source

Initializes the behaviour on a particle.

Override:

Behaviour#initialize

Params:

NameTypeAttributeDescription
particle object

the particle to initialize the behaviour on

Return:

*

void

public mutate(particle: object, time: number, index: integer): * source

Mutates the target's alpha/opacity property.

Override:

Behaviour#mutate

Params:

NameTypeAttributeDescription
particle object

the particle to apply the behaviour to

time number

engine time

index integer

the particle index

Return:

*

void

public reset(alphaA: number, alphaB: number, life: number, easing: function): * source

Resets the behaviour properties.

Override:

Behaviour#reset

Params:

NameTypeAttributeDescription
alphaA number

the starting alpha value

alphaB number
  • nullable: true

the ending alpha value

life number

the life of the behaviour

easing function

the easing equation to use for transforms

Return:

*

void