Home Reference Source
public class | source

Initializer

The base Emitter / Particle property class.

Static Method Summary

Static Public Methods
public static abstract

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

public static

Determines if the initializer requires a Web GL API to be provided to its constructor.

Constructor Summary

Public Constructor
public

constructor(type: string, isEnabled: boolean): *

Constructs an Initializer instance.

Member Summary

Public Members
public
public

type: *

Method Summary

Public Methods
public

init(emitter: Emitter, particle: Particle): *

Initializes the property on the emitter or particle.

public abstract

initialize(target: object)

Place custom property initialization code in this method in the subclass.

public abstract

reset()

Static Public Methods

public static abstract fromJSON(json: object): Behaviour source

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

Params:

NameTypeAttributeDescription
json object

JSON object containing the required constructor properties

Return:

Behaviour

public static requiresWebGlApi(): boolean source

Determines if the initializer requires a Web GL API to be provided to its constructor. If true, the WebGL API will need to be provided as the first argument to the constructor and fromJSON methods.

Return:

boolean

Public Constructors

public constructor(type: string, isEnabled: boolean): * source

Constructs an Initializer instance.

Params:

NameTypeAttributeDescription
type string
  • optional
  • default: INITIALIZER_TYPE_ABSTRACT

The intiializer type

isEnabled boolean
  • optional
  • default: true

Determines if the initializer should be enabled or not

Return:

*

void

Public Members

public isEnabled: * source

public type: * source

Public Methods

public init(emitter: Emitter, particle: Particle): * source

Initializes the property on the emitter or particle.

Params:

NameTypeAttributeDescription
emitter Emitter

the emitter to initialize the property on

particle Particle

the particle to intiialize the property on

Return:

*

void

See:

  • {@link '../emitter/emitter.js'} setupParticle

public abstract initialize(target: object) source

Place custom property initialization code in this method in the subclass.

Params:

NameTypeAttributeDescription
target object

either an Emitter or a Particle

public abstract reset() source