CPConfettiEmitter

org.cosplay.prefabs.particles.CPConfettiEmitter
class CPConfettiEmitter(xf: () => Int, yf: () => Int, genSize: Int, maxAge: Int, colors: Seq[CPColor], bgFg: CPColor, chf: Int => Char, z: Int) extends CPParticleEmitter

Particle emitter for confetti effect.

Value parameters

bgFg

A color to fade in to when a particle dies.

chf

Function that takes current age and return character to use for that frame.

colors

Set of colors to randomly color the particles.

genSize

Number of particles this emitter will emit on each frame update.

maxAge

Maximum age of the particle, i.e. how many frames it will be visible.

xf

X-coordinate producer for emission center.

yf

Y-coordinate producer for emission center.

z

Z-index to use to draw particles from this emitter.

Attributes

Source
CPConfettiEmitter.scala
Graph
Supertypes
trait CPAsset
class CPGameObject
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def emit(ctx: CPBaseContext): Iterable[CPParticle]

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.

Value parameters

ctx

Emission context.

Attributes

Definition Classes
Source
CPConfettiEmitter.scala
override def reset(): Unit

Resets this emitter to its initial state.

Resets this emitter to its initial state.

Attributes

Definition Classes
Source
CPConfettiEmitter.scala

Inherited methods

override def equals(obj: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • 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.

Definition Classes
CPGameObject -> Any
Inherited from:
CPGameObject
Source
CPGameObject.scala
def getId: String

Gets unique ID of this game object.

Gets unique ID of this game object.

Attributes

Inherited from:
CPGameObject
Source
CPGameObject.scala
def getTags: Set[String]

Gets optional set of organizational tags. Note that by default the set of tags is empty.

Gets optional set of organizational tags. Note that by default the set of tags is empty.

Attributes

See also
Inherited from:
CPGameObject
Source
CPGameObject.scala
def isPaused: Boolean

Tests whether or not this emitter is paused.

Tests whether or not this emitter is paused.

Attributes

Inherited from:
CPParticleEmitter
Source
CPParticleEmitter.scala
def pause(): Unit

Pause emission of the particles.

Pause emission of the particles.

Attributes

Inherited from:
CPParticleEmitter
Source
CPParticleEmitter.scala
def resume(reset: Boolean): Unit

Resumes emission of the particles.

Resumes emission of the particles.

Value parameters

reset

Whether or not to reset this emitter before resuming emission.

Attributes

Inherited from:
CPParticleEmitter
Source
CPParticleEmitter.scala
def toggle(): Unit

Toggles pause status of this emitter. Note that with this method you don't have the control of resetting the emitter before resuming its emission.

Toggles pause status of this emitter. Note that with this method you don't have the control of resetting the emitter before resuming its emission.

Attributes

Inherited from:
CPParticleEmitter
Source
CPParticleEmitter.scala

Inherited fields

override val getOrigin: String

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.

Attributes

Inherited from:
CPParticleEmitter
Source
CPParticleEmitter.scala