org.cosplay.prefabs.sprites

Members list

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, var onFinish: CPSceneObjectContext => Unit, autoDelete: Boolean, tags: Seq[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.

Attributes

Source
CPBubbleSprite.scala
Supertypes
trait CPLifecycle
class CPGameObject
class Object
trait Matchable
class Any
Show all
class CPCenteredImageSprite(id: String, img: CPImage, z: Int, shaders: Seq[CPShader], orient: CPCenteredImageSpriteOrientation, tags: Seq[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.

orient

Centering orientation. Default value is CPCenteredImageSpriteOrientation.BOTH. Note that you need set requires X or Y coordinates manually if not using CPCenteredImageSpriteOrientation.BOTH orientation.

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.

Attributes

See also
Source
CPCenteredImageSprite.scala
Supertypes
trait CPLifecycle
class CPGameObject
class Object
trait Matchable
class Any
Show all

Orientation of centering for CPCenteredImageSprite instance.

Orientation of centering for CPCenteredImageSprite instance.

Attributes

Source
CPCenteredImageSprite.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all