Repository navigation
Examples: a Sprite showcase, in space - #1790
Merged
Merged
Conversation
The sprite example was two monsters turning over a galaxy, built in the preload callback through the global `game`. It is now a small scene showing what a Sprite can do, built in its own Stage from the app instance: - the monster in the middle breathes and leans (scale, rotate) and wears a different shader effect every few seconds, or on a click: Glow, Shine, Sway, Hologram, Dissolve, then Outline and Glow chained; - eight coins cut from the platformer's TexturePacker atlas orbit it, spinning (scale, flipX) under one shared Shine, and pass in front of it and behind it (depth, with world.sortNow()); - the astronaut drifts across, walking in mid-air (addAnimation, play), facing the way it goes and turning; flies buzz in figures of eight; - small monsters float about, tinted, fading, two of them additive. The backdrop is Earth Defender's nebula drawn once at the size of the screen with the same noise, larger and dimmer so the sprites read: a 32 KB WebP. On Canvas everything but the effects runs, and the caption says so. Also: TextureAtlas#createAnimationFromName had no documentation since #1008 put getAnimationSettings between it and its doc comment, so its docs sat on the wrong method and TypeScript required both its arguments. The comment is back on its method (with a typo fixed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx
obiot
added a commit
that referenced
this pull request
Oct 30, 2026
Dates the 20.12.0 changelog section (2026-10-30) and adds the one shipped change it was missing: TextureAtlas#createAnimationFromName's arguments are optional in the declarations again (#1790). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the sprite example (two monsters turning over a galaxy, built in the preload callback through the global
game) with a small scene in space showing what a Sprite can do. It is built in its ownStage, from the app instance.scale,rotate). It wears a different shader effect every 3.5 s, or on a click (isKinematic = false,registerPointerEvent): Glow, Shine, Sway, Hologram, Dissolve, then Outline + Glow chained. The effects are added once and switched withenabled, sinceremovePostEffectdestroys them.scale,flipX) under one sharedShineEffect(shared = true), and pass in front of the monster and behind it by changingdepth. A world sorted on"z"does not re-sort on a depth change, so the example callsworld.sortNow()when a coin changes side.addAnimation,play), facing the way it goes and turning. Two flies buzz in figures of eight.setOpacity), two of them additive (blendMode = "lighter").sprite/assets/nebula.webp, 32 KB.galaxy.pngstays, as the mesh3d and blend-mode examples load it from this folder.Also, docs only:
TextureAtlas#createAnimationFromNamehad no documentation. Since #1008 putgetAnimationSettingsbetween the method and its doc comment, its docs sat on the wrong method, and TypeScript required both of its arguments. The comment is back on its method, with a typo fixed. Both arguments are now optional in the declarations, as they always were at runtime.Type of change
Checklist
pnpm lintpasses): biome on the changed files, eslint onatlas.jspnpm testpasses): example only; the engine change is a doc commentpnpm build):pnpm typesregenerated the declarations (createAnimationFromName(names?, settings?))Checked in a browser: the example runs on WebGL, WebGPU and Canvas with no console errors. Clicking the monster steps through all six looks. The near coins draw over the monster and the far ones behind it.
Related issues
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx