Home Reference Source
public class | source

Body

Extends:

Initializer → Body

Sets the body property on initialized 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(body: string | number | object, w: number, h: number): *

Constructs a Body initalizer instance.

Member Summary

Public Members
public

The content for the particle body

public

The height of the particle Body

public

The width of the particle Body

Method Summary

Public Methods
public

initialize(particle: Particle): *

Sets the particle's initial body.

Inherited Summary

From class Initializer
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.

public
public

type: *

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 fromJSON(json: object): Body source

Creates a Body initializer from JSON.

Override:

Initializer#fromJSON

Params:

NameTypeAttributeDescription
json object

The JSON to construct the instance from.

Return:

Body

Return Properties:

NameTypeAttributeDescription
json.body number

The color for the particle body

json.width number

The width of the particle body

json.height number

The height of the particle body

Public Constructors

public constructor(body: string | number | object, w: number, h: number): * source

Constructs a Body initalizer instance.

Override:

Initializer#constructor

Params:

NameTypeAttributeDescription
body string | number | object

The content for the particle body, can be a color or an object (mesh)

w number
  • nullable: true

The width of the particle body

h number
  • nullable: true

The height of the particle body

Return:

*

void

Public Members

public body: ArraySpan source

The content for the particle body

public h: number source

The height of the particle Body

public w: number source

The width of the particle Body

Public Methods

public initialize(particle: Particle): * source

Sets the particle's initial body.

Override:

Initializer#initialize

Params:

NameTypeAttributeDescription
particle Particle

the particle to initialize the property on

Return:

*

void