CPConfettiParticle

org.cosplay.prefabs.particles.CPConfettiParticle
class CPConfettiParticle(initX: Int, initY: Int, dx: Float, dy: Float, maxAge: Int, colors: Seq[CPColor], bgFg: CPColor, chf: Int => Char, z: Int) extends CPParticle

Particle for confetti effect.

Value parameters

bgFg

A color to fade in to when this particle dies.

chf

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

colors

Set of colors to randomly color the particle at each frame.

dx

Per-frame x-speed.

dy

Per-frame y-speed.

initX

Initial x-coordinate.

initY

Initial y-coordinate.

maxAge

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

z

Z-index to use to draw this particle.

Attributes

Source
CPConfettiParticle.scala
Graph
Supertypes
trait CPParticle
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def getPixel: CPPixel

Gets pixel for this particle.

Gets pixel for this particle.

Attributes

Definition Classes
Source
CPConfettiParticle.scala
override def getX: Int

Gets current X-coordinate of this particle.

Gets current X-coordinate of this particle.

Attributes

Definition Classes
Source
CPConfettiParticle.scala
override def getY: Int

Gets current Y-coordinate of this particle.

Gets current Y-coordinate of this particle.

Attributes

Definition Classes
Source
CPConfettiParticle.scala
override def isAlive: Boolean

Tests whether or not this particle is alive. Dead particles will be discarded by the particle sprite and won't be rendered anymore. This method is used to check every particle on each frame update.

Tests whether or not this particle is alive. Dead particles will be discarded by the particle sprite and won't be rendered anymore. This method is used to check every particle on each frame update.

Attributes

Definition Classes
Source
CPConfettiParticle.scala
override def update(ctx: CPSceneObjectContext): Unit

This method is called on each frame update. Technically, a particle sprite call this method when it itself receives CPSceneObject.update callback passing its own scene context to this callback.

This method is called on each frame update. Technically, a particle sprite call this method when it itself receives CPSceneObject.update callback passing its own scene context to this callback.

Value parameters

ctx

Scene object context of the particle sprite.

Attributes

Definition Classes
Source
CPConfettiParticle.scala

Concrete fields

override val getZ: Int

Gets current Z-index of this particle.

Gets current Z-index of this particle.

Attributes

Source
CPConfettiParticle.scala