Skip to content

[Epic] Sprite atlas support #569

Description

@stormmuller

Goal

Add sprite atlas (texture packer) support to the rendering module. src/rendering currently only supports loading single-image textures (create-texture-from-image.ts) plus manually-defined nine-slice regions — there's no support for parsing a packed atlas format and looking up sprite regions by name.

Scope (suggested)

  • Support at least one common atlas JSON format (e.g. TexturePacker's JSON hash/array format, or a simple custom format if a standard one adds too much surface area initially).
  • A way to reference a sprite by name from an atlas and get back its UV/pixel region, feeding into the existing sprite component/rendering path.
  • Should compose with the existing instanced sprite-batching so atlas-packed sprites still batch efficiently (this is usually the actual point of atlases — fewer texture binds per draw call).
  • Consider whether this should also support atlas-packed sprite-sheet animations (src/animations), since sprite-sheet frame animation already exists and would benefit from atlas-backed frames.

Why this is a milestone, not a single issue

Touches asset loading (atlas parsing), rendering (region lookup + batching), and potentially animations (atlas-backed animation frames) — worth sequencing as its own set of sub-issues rather than one PR.

Acceptance criteria (top-level)

  • An atlas can be loaded and individual sprite regions referenced by name
  • Atlas-packed sprites still batch efficiently in the renderer
  • Documented in documentation-site/docs/docs/rendering with a demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions