Sprite

final case class Sprite[M <: Material](bindingKey: BindingKey, material: M, animationKey: AnimationKey, animationActions: Batch[AnimationAction], eventHandlerEnabled: Boolean, eventHandler: ((Sprite[_], GlobalEvent)) => Option[GlobalEvent], position: Point, rotation: Radians, scale: Vector2, depth: Depth, ref: Point, flip: Flip) extends DependentNode[Sprite[M]] with Cloneable with SpatialModifiers[Sprite[M]]

Sprites are used to represented key-frame animated screen elements.

Companion:
object
trait Serializable
trait Product
trait Equals
trait Cloneable
trait SceneNode
class Object
trait Matchable
class Any

Type members

Inherited types

type Out = T
Inherited from:
DependentNode

Value members

Concrete methods

def changeCycle(label: CycleLabel): Sprite[M]
def flipHorizontal(isFlipped: Boolean): Sprite[M]
def flipVertical(isFlipped: Boolean): Sprite[M]
def jumpToFrame(number: Int): Sprite[M]
def modifyMaterial[MB <: Material](alter: M => MB): Sprite[MB]
def moveBy(pt: Point): Sprite[M]
def moveBy(x: Int, y: Int): Sprite[M]
def moveTo(pt: Point): Sprite[M]
def moveTo(x: Int, y: Int): Sprite[M]
def play(): Sprite[M]
def rotateBy(angle: Radians): Sprite[M]
def rotateTo(angle: Radians): Sprite[M]
def scaleBy(amount: Vector2): Sprite[M]
def scaleBy(x: Double, y: Double): Sprite[M]
def scrubTo(position: Double): Sprite[M]

Moves the sprite's playhead to a position down the timeline based on a value ranged 0.0 to 1.0, where 0.0 is the start and 1.0 is the end of the timeline.

Moves the sprite's playhead to a position down the timeline based on a value ranged 0.0 to 1.0, where 0.0 is the start and 1.0 is the end of the timeline.

Value parameters:
position

A value between 0.0d and 1.0d

Returns:

Sprite[Material]

def transformBy(positionDiff: Point, rotationDiff: Radians, scaleDiff: Vector2): Sprite[M]
def transformTo(newPosition: Point, newRotation: Radians, newScale: Vector2): Sprite[M]
def withAnimationKey(newAnimationKey: AnimationKey): Sprite[M]
def withBindingKey(newBindingKey: BindingKey): Sprite[M]
def withDepth(newDepth: Depth): Sprite[M]
def withFlip(newFlip: Flip): Sprite[M]
def withMaterial[MB <: Material](newMaterial: MB): Sprite[MB]
def withPosition(newPosition: Point): Sprite[M]
def withRef(newRef: Point): Sprite[M]
def withRef(x: Int, y: Int): Sprite[M]
def withRotation(newRotation: Radians): Sprite[M]
def withScale(newScale: Vector2): Sprite[M]

Inherited methods

Inherited from:
Product

Concrete fields

lazy val x: Int
lazy val y: Int