Conversation
- setTint() applies to skeleton.color — RGB tinting on WebGL, alpha-only on Canvas - Canvas SkeletonRenderer passes premultipliedAlpha to setBlendMode() - fix scale() double-applying on Canvas (root bone + currentTransform) - fix skin.attachments.entries() crash — plain objects, not Maps - fix draw() crash when skeleton not yet initialized - Cached isWebGL flag, removed unused properties (this.gl, this.renderer, this.context, this.twoColorTint) - Fix DebugPanelPlugin type cast in spine example Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the @melonjs/spine-plugin to v2.2.0 with several rendering fixes and small internal cleanups, aiming to improve Spine tinting, PMA blending behavior, and Canvas transform correctness.
Changes:
- Apply Renderable tint to the Spine skeleton color and add a guard for early
draw()calls before skeleton initialization. - Improve Canvas rendering: pass through PMA intent to blend mode selection and fix Canvas scaling being applied twice.
- Fix mesh-detection iteration over
skin.attachmentsto avoid crashes, and bump plugin/tooling versions + docs/changelog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spine-plugin/src/Spine.js | Adds isWebGL caching, adjusts tinting behavior, fixes Canvas scaling, and hardens draw()/mesh detection. |
| packages/spine-plugin/src/SkeletonRenderer.js | Adds premultipliedAlpha flag and forwards it to blend-mode selection in the Canvas Spine renderer. |
| packages/spine-plugin/package.json | Bumps plugin version to 2.2.0 and updates esbuild. |
| packages/spine-plugin/README.md | Documents version compatibility for v2.2.0. |
| packages/spine-plugin/CHANGELOG.md | Adds v2.2.0 release notes dated 2026-04-15. |
| packages/examples/src/examples/spine/ExampleSpine.tsx | Tightens typing when showing the debug panel plugin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
148
to
+152
| renderer.setGlobalAlpha(color.a); | ||
| renderer.setTint(color); | ||
| renderer.setBlendMode(BLEND_MODES[slot.data.blendMode]); | ||
| renderer.setBlendMode( | ||
| BLEND_MODES[slot.data.blendMode], | ||
| this.premultipliedAlpha, |
Comment on lines
+150
to
+153
| renderer.setBlendMode( | ||
| BLEND_MODES[slot.data.blendMode], | ||
| this.premultipliedAlpha, | ||
| ); |
Comment on lines
+392
to
+395
| // apply melonJS tint to Spine skeleton color | ||
| const t = this.tint.toArray(); | ||
| this.skeleton.color.set(t[0], t[1], t[2], this.skeleton.color.a); | ||
|
|
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.
Summary
setTint()now applies toskeleton.color— RGB tinting on WebGL, alpha-only on CanvasSkeletonRendererpassespremultipliedAlphatosetBlendMode()for correct PMA blendingscale()double-applying on Canvas (root bone + currentTransform)skin.attachments.entries()crash — inner attachments are plain objects, not Mapsdraw()crash when skeleton not yet initializedisWebGLflag, removed unused propertiesTest plan
🤖 Generated with Claude Code