Particle defines a single-pixel element (a-la mini-sprite) that has its own lifecycle and gets updated on each frame update. Particle emitter is a components that is responsible for creating particles. And particle sprite ties all that together into single renderable component. Particle sprite can have one or more particle emitters and each emitter can create multiple particles. One of the key features of particle effect support is its modularity: particle implementation can be reused by multiple emitters, and an emitter implementation can be reused by multiple independent particle sprites.
Particle emitter is an asset. Just like other assets such as fonts, images, animations or videos they are not managed or governed by the CosPlay game engine unlike scenes and scene objects that are managed and governed by the game engine. Assets are typically created outside the game loop and managed by the developer, they can be freely shared between scenes or scene objects as any other standard Scala objects.
Value parameters
id
Unique ID of this emitter. By default, a random 6-character ID will be used.
tags
Optional set of organizational tags. These tags are here only for the game developer benefits as they are not used by the game engine itself. By default, the empty set is used.
Attributes
Example
See CPParticleExample class for the example of using particle effect.
Gets collections of particles that constitutes a particle emission for this frame update. Note that this method is called on each frame update by the particle sprite.
Gets collections of particles that constitutes a particle emission for this frame update. Note that this method is called on each frame update by the particle sprite.
It is reflexive: for any instance x of type Any, x.equals(x) should return true.
It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).
Value parameters
that
the object to compare against this object for equality.
Attributes
Returns
true if the receiver object is equivalent to the argument; false otherwise.
Gets the origin of this asset. Typically, this should be a URL, file name or class name for in-code assets like array images, animations or system font.
Gets the origin of this asset. Typically, this should be a URL, file name or class name for in-code assets like array images, animations or system font.