Sprite

indigo.shared.scenegraph.Sprite
See theSprite companion object
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]], Cloneable, SpatialModifiers[Sprite[M]]

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

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Cloneable
trait DependentNode[Sprite[M]]
trait SceneNode
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type Out = T

Attributes

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 onEvent(f: PartialFunction[(Sprite[_], GlobalEvent), GlobalEvent]): 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

Attributes

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 withEventHandler(f: ((Sprite[_], GlobalEvent)) => Option[GlobalEvent]): 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

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy val x: Int
lazy val y: Int