Emitter

clay.particle. Emitter

# new Emitter()

Source:

Extends

Members

# __uid__ :number

Source:
Inherited From:
Type:
  • number

# amount :number

Source:

Number of particles created by this emitter each shot

Type:
  • number

# (nullable) angularVelocity :clay.Value.<clay.Vector3>

Source:

Particle angular velocity generator

Type:

# (nullable) life :clay.Value.<number>

Source:

Particle life generator

Type:

# max :number

Source:

Maximum number of particles created by this emitter

Type:
  • number

# (nullable) position :clay.Value.<clay.Vector3>

Source:

Particle position generator

Type:

# (nullable) rotation :clay.Value.<clay.Vector3>

Source:

Particle rotation generator

Type:

# (nullable) spriteSize :clay.Value.<number>

Source:

Particle sprite size generator

Type:

# (nullable) velocity :clay.Value.<clay.Vector3>

Source:

Particle velocity generator

Type:

# (nullable) weight :clay.Value.<number>

Source:

Particle weight generator

Type:

Methods

# (static) constant()

Source:

Create a constant 1d value generator. Alias for clay.Value.constant

# (static) random1D()

Source:

Create a random 1d value generator. Alias for clay.Value.random1D

# (static) random2D()

Source:

Create a random 2d value generator. Alias for clay.Value.random2D

# (static) random3D()

Source:

Create a random 3d value generator. Alias for clay.Value.random3D

# (static) vector()

Source:

Create a constant vector value(2d or 3d) generator. Alias for clay.Value.vector

# after(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('after' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# before(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('before' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# emit(out)

Source:

Emitter number of particles and push them to a given particle list. Emmit number is defined by amount property

Parameters:
Name Type Description
out Array.<clay.particle.Particle>

# error(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('error')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# has(name, action) → {boolean}

Source:
Inherited From:
Mixes In:

If registered the event handler

Parameters:
Name Type Description
name string
action function
Returns:
Type
boolean

# kill(particle)

Source:

Kill a dead particle and put it back in the pool

Parameters:
Name Type Description
particle clay.particle.Particle

# off(action, contextopt)

Source:
Inherited From:
Mixes In:

Remove event listener

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# on(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event handler

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# once(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event, event will only be triggered once and then removed

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# success(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('success')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# trigger(name)

Source:
Inherited From:
Mixes In:

Trigger event

Parameters:
Name Type Description
name string