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.