org.cosplay.prefabs.sprites

Type members

Classlikes

class CPBubbleSprite(id: String, img: CPImage, initX: Int, initY: Int, z: Int, dxf: CPSceneObjectContext => Float, dyf: CPSceneObjectContext => Float, bgPx: CPPixel, durMs: Long, onFinish: CPSceneObjectContext => Unit, autoDelete: Boolean, tags: String*) extends CPImageSprite

Image sprite that provides moving and fading out image effect. This typically can be used for word or speech bubbles in the game and such.

Image sprite that provides moving and fading out image effect. This typically can be used for word or speech bubbles in the game and such.

Value parameters:
autoDelete

Optional flag on whether or not to auto-delete the sprite from its scene when the effect is finished. Default value is true.

bgPx

Background pixel to fade out to.

durMs

Duration of the shader effect in milliseconds.

dxf

Function providing per-frame X-coordinate delta. Defines speed of movement on X-axis.

dyf

Function providing per-frame Y-coordinate delta. Defines speed of movement on Y-axis.

id

Optional ID of the sprite.

img

The image to render. It can be changed later.

initX

Initial X-coordinate of the sprite.

initY

Initial Y-coordinate of the sprite.

onFinish

Optional callback to call when the effect is finished. Default is a np-op.

tags

Optional set of organizational or grouping tags. By default, the empty set is used.

z

Z-index at which to render the image.

Source:
CPBubbleSprite.scala
class CPCenteredImageSprite(id: String, img: CPImage, z: Int, shaders: Seq[CPShader], tags: String*) extends CPImageSprite

Image sprite that centers its image on the canvas on each frame update.

Image sprite that centers its image on the canvas on each frame update.

Value parameters:
id

Optional ID of the sprite.

img

The image to render. It can be changed later.

shaders

Optional sequence of shaders for this sprite. Default value is an empty sequence.

tags

Optional set of organizational or grouping tags. By default, the empty set is used.

z

Z-index at which to render the image.

Source:
CPCenteredImageSprite.scala