Skip to content

Document that animated NobleSprites need setSize(), and that NobleSprite:draw() is a render callback - #97

Open
ericlewis wants to merge 1 commit into
NobleRobot:mainfrom
ericlewis:docs/animated-sprite-notes
Open

Document that animated NobleSprites need setSize(), and that NobleSprite:draw() is a render callback#97
ericlewis wants to merge 1 commit into
NobleRobot:mainfrom
ericlewis:docs/animated-sprite-notes

Conversation

@ericlewis

Copy link
Copy Markdown

Closes #83; should also prevent confusion like #91.

Two documentation gaps that bite users of animated NobleSprites:

  1. Sprites sourced from a spritesheet or Noble.Animation need setSize() (Note in the documentation that NobleSprites sourced from imagetables need to have their size set manually #83). Unlike image-based sprites, which are auto-sized via setImage(), animated sprites never get a size, so without setSize() they are never drawn. The NobleSprite usage examples now include the setSize() call, and Noble.Animation.new() notes it as well.

  2. NobleSprite:draw() is a render callback, not an immediate-mode draw (Animated NobleSprite renders at incorrect location. #91). It's the sprite draw callback invoked by Graphics.sprite.update() in sprite-local coordinates, so calling it manually draws the animation at the wrong location — which is what happened in Animated NobleSprite renders at incorrect location. #91. It's now documented as such, pointing users to myNobleSprite.animation:draw(x, y) for immediate-mode drawing, or setSize() + add(x, y) for scene placement.

The generated HTML pages are hand-patched to match (no LDoc in my environment) — happy to regenerate if you'd rather.

🤖 Generated with Claude Code

…ite:draw() is a render callback.

Sprites whose view is a spritesheet/imagetable or a Noble.Animation do
not get their size set automatically (unlike image-based sprites, which
are auto-sized via setImage()), so they must call setSize() with the
frame dimensions or they will never be drawn. The spritesheet usage
examples now include the setSize() call, and Noble.Animation.new()
notes it as well. (upstream issue NobleRobot#83)

NobleSprite:draw() is now documented as the sprite draw callback
invoked by Graphics.sprite.update() in sprite-local coordinates, which
must not be called manually; use myNobleSprite.animation:draw(x, y) for
immediate-mode drawing, or setSize() plus add(x, y) for scene
placement. (upstream issue NobleRobot#91)

The generated HTML docs were hand-patched to match, since ldoc is not
available in this environment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for cheery-choux-736619 ready!

Name Link
🔨 Latest commit 8ba99e6
🔍 Latest deploy log https://app.netlify.com/projects/cheery-choux-736619/deploys/6a7af311a3234c0008c540ae
😎 Deploy Preview https://deploy-preview-97--cheery-choux-736619.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Note in the documentation that NobleSprites sourced from imagetables need to have their size set manually

1 participant