Home Reference Source
public class | source

Texture

Extends:

Initializer → Texture

Sets the body property to be a THREE.Sprite with a texture map on initialized particles.

Static Method Summary

Static Public Methods
public static

fromJSON(json: object, THREE: object): BodySprite

Creates a Texture initializer from JSON.

Constructor Summary

Public Constructor
public

constructor(THREE: object, texture: string, materialProperties: object | undefined, loadedTexture: Texture)

Constructs an Texture initializer.

Member Summary

Public Members
public

material: SpriteMaterial

THREE.SpriteMaterial instance.

public

The material properties for this object's SpriteMaterial NOTE This is required for testing purposes

public

sprite: Sprite

THREE.Sprite instance.

public

The texture for the THREE.SpriteMaterial map.

Method Summary

Public Methods
public

initialize(particle: Particle): *

Sets the particle body to the sprite.

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, THREE: object): BodySprite source

Creates a Texture initializer from JSON.

Override:

Initializer#fromJSON

Params:

NameTypeAttributeDescription
json object

The JSON to construct the instance from

THREE object

The Web GL API we are using eg., THREE

json.loadedTexture Texture

The loaded sprite texture

json.materialProperties object

The sprite material properties

Return:

BodySprite

Public Constructors

public constructor(THREE: object, texture: string, materialProperties: object | undefined, loadedTexture: Texture) source

Constructs an Texture initializer.

Override:

Initializer#constructor

Params:

NameTypeAttributeDescription
THREE object

The Web GL API we are using eg., THREE

texture string

The sprite texture

materialProperties object | undefined

The sprite material properties

loadedTexture Texture
  • nullable: true

Preloaded THREE.Texture instance

Public Members

public material: SpriteMaterial source

THREE.SpriteMaterial instance.

public materialProperties: object source

The material properties for this object's SpriteMaterial NOTE This is required for testing purposes

public sprite: Sprite source

THREE.Sprite instance.

public texture: Texture source

The texture for the THREE.SpriteMaterial map.

Public Methods

public initialize(particle: Particle): * source

Sets the particle body to the sprite.

Override:

Initializer#initialize

Params:

NameTypeAttributeDescription
particle Particle

The particle to set the body of

Return:

*

void