Skip to content

Sprite

INFO

Inherits: Graphic

A basic image.

Example:

ts
const spr = new Sprite({
  path: 'anim.png',
  layer: 'Background',
  origin: 'Centre',
  position: [320, 240],
})

Constructor details

ts
new Sprite({ path, layer, origin, commands })
  • Parameters:
    • path (string): The path to the image's file relative to the beatmap folder.
    • layer (Layer) (Layer): The layer on which the sprite resides.
    • origin (Origin) (Origin): The origin point of the sprite.
    • position (IVector2 | Vector2Tuple | Vector2) (Vector2): The position of the sprite.
    • commands (Command[] | undefined) (Command): The commands of this sprite. Defaults to undefined.

Properties

Properties inherited from Graphic:

layer, origin, path, position, commands

Methods

Methods inherited from Graphic:

fade, move, moveX, moveY, scale, scaleVec, rotate, color, flipH, flipV, additive, startLoopGroup, startTriggerGroup, endGroup

toString()

Return a string representation of this sprite.

  • Returns: string