Class SpriteSheet

Stores a sprite sheet.

Functions

SpriteSheet.new (base, size, pixels) Creates a new sprite sheet.

Methods

SpriteSheet:get_sprite (x, y) Gets a sprite from a sheet.
SpriteSheet:set_as (id) Overrides a builtin sprite sheet.


Functions

Methods
SpriteSheet.new (base, size, pixels)
Creates a new sprite sheet.

Parameters:

  • base TexAsset The texture to use for the sheet
  • size Vec2 The size (in sprites) of the sheet
  • pixels Vec2 The size (in pixels) of a sprite

Methods

SpriteSheet:get_sprite (x, y)
Gets a sprite from a sheet.

Parameters:

  • x integer The x position of the sprite.
  • y integer The y position of the sprite.

Returns:

    Sprite The sprite at the position
SpriteSheet:set_as (id)
Overrides a builtin sprite sheet.

Parameters:

  • id integer the sprite sheet to override

See also:

generated by LDoc 1.5.0 Last updated 2024-05-23 11:40:37