Skip to content

Spine plugin 2.2.0#1387

Merged
obiot merged 1 commit intomasterfrom
fix/spine-plugin-2.2.0
Apr 15, 2026
Merged

Spine plugin 2.2.0#1387
obiot merged 1 commit intomasterfrom
fix/spine-plugin-2.2.0

Conversation

@obiot
Copy link
Copy Markdown
Member

@obiot obiot commented Apr 15, 2026

Summary

  • setTint() now applies to skeleton.color — RGB tinting on WebGL, alpha-only on Canvas
  • Canvas SkeletonRenderer passes premultipliedAlpha to setBlendMode() for correct PMA blending
  • Fix scale() double-applying on Canvas (root bone + currentTransform)
  • Fix skin.attachments.entries() crash — inner attachments are plain objects, not Maps
  • Fix draw() crash when skeleton not yet initialized
  • Internal cleanup: cached isWebGL flag, removed unused properties

Test plan

  • All spine examples render correctly in WebGL
  • Coin, Cloud Pot, Spineboy render correctly in Canvas
  • Tank mesh rendering is a known pre-existing Canvas limitation (mesh positions)
  • Build passes

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings April 15, 2026 10:42
@obiot obiot merged commit a78a790 into master Apr 15, 2026
8 checks passed
@obiot obiot deleted the fix/spine-plugin-2.2.0 branch April 15, 2026 10:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.attachments to 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);

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.

2 participants