Module components_multisprite

Renders a selected cell from a sprite sheet.

See also:

Info:

  • Author: Sharper Dev

Functions

MultiSprite:new (gameObject) Creates a MultiSprite with a 16×16 cell size and cursor at (0, 0).
MultiSprite:render () Draws the selected sprite-sheet cell when the component is enabled.

Tables

self.cellSize The size of each cell in the sprite sheet.
self.cellCursor The current cell cursor position.


Functions

MultiSprite:new (gameObject)
Creates a MultiSprite with a 16×16 cell size and cursor at (0, 0).

Parameters:

  • gameObject table Game object that owns this component.

Returns:

    table The new MultiSprite component.

Usage:

    local multi = gameObject:addComponent("MultiSprite")
MultiSprite:render ()
Draws the selected sprite-sheet cell when the component is enabled.

Tables

self.cellSize
The size of each cell in the sprite sheet.

Fields:

  • x integer The width of each cell.
  • y integer The height of each cell.
self.cellCursor
The current cell cursor position.

Fields:

  • x integer The x position of the cell cursor.
  • y integer The y position of the cell cursor.
generated by LDoc 1.5.0 Last updated 2026-10-04 12:53:32