Skip to main content

Spritesheet

Data model for sprite sheets

Functions

new

Spritesheet.new(texturestring) → Spritesheet

Constructs a new Spritesheet

GetPreloadAssetId

Spritesheet:GetPreloadAssetId() → string

Retrieves the preload asset ids to use

AddSprite

Spritesheet:AddSprite(
keyCodeany,
positionVector2,
sizeVector2
) → ()

Adds a named sprite at the given keyCode

GetSprite

Spritesheet:GetSprite(keyCodeany | EnumItem) → Sprite?

Retrieves the sprite for the given keyCode

HasSprite

Spritesheet:HasSprite(keyCodeany | EnumItem) → boolean

Returns true if the sprite exists

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new Spritesheet",
            "params": [
                {
                    "name": "texture",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Spritesheet"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 19,
                "path": "src/sprites/src/Shared/Sprite/Spritesheet.lua"
            }
        },
        {
            "name": "GetPreloadAssetId",
            "desc": "Retrieves the preload asset ids to use",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 32,
                "path": "src/sprites/src/Shared/Sprite/Spritesheet.lua"
            }
        },
        {
            "name": "AddSprite",
            "desc": "Adds a named sprite at the given keyCode",
            "params": [
                {
                    "name": "keyCode",
                    "desc": "",
                    "lua_type": "any"
                },
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector2"
                },
                {
                    "name": "size",
                    "desc": "",
                    "lua_type": "Vector2"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 43,
                "path": "src/sprites/src/Shared/Sprite/Spritesheet.lua"
            }
        },
        {
            "name": "GetSprite",
            "desc": "Retrieves the sprite for the given keyCode",
            "params": [
                {
                    "name": "keyCode",
                    "desc": "",
                    "lua_type": "any | EnumItem"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Sprite?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 61,
                "path": "src/sprites/src/Shared/Sprite/Spritesheet.lua"
            }
        },
        {
            "name": "HasSprite",
            "desc": "Returns true if the sprite exists",
            "params": [
                {
                    "name": "keyCode",
                    "desc": "",
                    "lua_type": "any | EnumItem"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/sprites/src/Shared/Sprite/Spritesheet.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Spritesheet",
    "desc": "Data model for sprite sheets",
    "source": {
        "line": 5,
        "path": "src/sprites/src/Shared/Sprite/Spritesheet.lua"
    }
}