Constructor
new Particle(position, tileInfo, angle, colorStart, colorEnd, lifeTime, sizeStart, sizeEnd, fadeRate, additive, trailScale, localSpaceEmitteropt, destroyCallbackopt)
Create a particle with the passed in settings Typically this is created automatically by a ParticleEmitter
Name | Type | Attributes | Description |
---|---|---|---|
position | Vector2 | World space position of the particle | |
tileInfo | TileInfo | Tile info to render particles | |
angle | number | Angle to rotate the particle | |
colorStart | Color | Color at start of life | |
colorEnd | Color | Color at end of life | |
lifeTime | number | How long to live for | |
sizeStart | number | Size at start of life | |
sizeEnd | number | Size at end of life | |
fadeRate | number | How quick to fade in/out | |
additive | boolean | Does it use additive blend mode | |
trailScale | number | If a trail, how long to make it | |
localSpaceEmitter | ParticleEmitter | <optional> | Parent emitter if local space |
destroyCallback | ParticleCallbackFunction | <optional> | Callback when particle dies |
- Source
Extends
- EngineObject
Members
additive
PropertiesType | Description |
---|---|
boolean | Is it additive |
- Source
colorEnd
PropertiesType | Description |
---|---|
Color | Color at end of life |
- Source
colorStart
PropertiesType | Description |
---|---|
Color | Color at start of life |
- Source
destroyCallback
PropertiesType | Description |
---|---|
ParticleCallbackFunction | Called when particle dies |
- Source
fadeRate
PropertiesType | Description |
---|---|
number | How quick to fade in/out |
- Source
lifeTime
PropertiesType | Description |
---|---|
number | How long to live for |
- Source
localSpaceEmitter
PropertiesType | Description |
---|---|
ParticleEmitter | Parent emitter if local space |
- Source
sizeEnd
PropertiesType | Description |
---|---|
number | Size at end of life |
- Source
sizeStart
PropertiesType | Description |
---|---|
number | Size at start of life |
- Source
trailScale
PropertiesType | Description |
---|---|
number | If a trail, how long to make it |
- Source
Methods
render()
Render the particle, automatically called each frame, sorted by renderOrder
- Source
update()
Update the object physics, called automatically by engine once each frame
- Source