SiliconGhetto Engine API
    Preparing search index...

    Function addAnimation

    • Register a named sprite animation on an entity.

      Parameters

      • entity: number

        The entity ID

      • name: string

        Animation name (e.g. "idle", "walk", "attack")

      • opts: AnimationOpts

        Animation configuration (frame indices, fps, loop)

      Returns void

      sg.addAnimation(player, 'walk', { frames: [0, 1, 2, 3], fps: 8, loop: true });