Skip to content

Compositions ignore derived-sprite shift and the {sprite, x, y} layer renders nothing #17

Open

Description

@scbrown
{ type: "palette", name: "p", colors: { _: "transparent", x: "#ff0000" } }
{ type: "sprite", name: "dot", size: [4, 4], palette: "p", regions: { x: { points: [[0, 0]] } } }
{ type: "sprite", name: "dot_moved", palette: "p", source: "dot", transform: ["shift:2,2"] }
{ type: "composition", name: "scene", size: [4, 4], cell_size: [4, 4],
  sprites: { D: "dot_moved" }, layers: [{ map: ["D"] }] }

pxl render -s dot_moved puts the dot at (2,2), but pxl render -c scene puts
it at (0,0). The composition path (render_composition_to_image) renders the
resolved regions and skips the derived sprite's image transform. The
{ sprite, x, y } layer form in format/composition.md doesn't help either: it
renders an empty canvas. The only offset left is cell_size with a
mismatched map, and that warns on every render. Workaround: the talking
poses skull_jaw_ajar and skull_jaw_open are written out in full as their
own sprites, not as shift-ed copies of skull_jaw.

Found while drawing examples/skull (#13). The repro is checked against main.

🤖 Generated with Claude Code

Activity

  1. scbrown commented on Sep 26, 2026

    @scbrown
    OwnerAuthor

    Also seen while animating the skull (#21): a shifted copy of a sprite, used as a GIF frame, renders empty and emits a misleading 'deprecated grid format' warning. Details in examples/skull/GAPS.md section 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions