@melonjs/spine-plugin 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +13 -5
- package/build/SkeletonRenderer.d.ts +6 -0
- package/build/SkeletonRenderer.d.ts.map +1 -1
- package/build/Spine.d.ts +3 -11
- package/build/Spine.d.ts.map +1 -1
- package/build/SpinePlugin.d.ts.map +1 -1
- package/build/index.js +112 -95
- package/build/index.js.map +3 -3
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.0 - 2026-04-15
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `setTint()` now applies to `skeleton.color` — RGB tinting works on WebGL, Canvas is limited to alpha only
|
|
7
|
+
- Canvas `SkeletonRenderer` now passes `premultipliedAlpha` to `setBlendMode()` for correct blending with PMA textures
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- fix `scale()` double-applying on Canvas — was scaling through both root bone and canvas context
|
|
11
|
+
- fix `skin.attachments.entries()` crash in mesh detection — inner attachments are plain objects, not Maps
|
|
12
|
+
- fix potential crash when `draw()` is called before `setSkeleton` completes
|
|
13
|
+
|
|
14
|
+
## 2.1.0
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- Tiled integration: Spine objects can now be placed directly in Tiled maps — set the object class to "Spine" and add `atlasFile`/`jsonFile` custom properties. The plugin registers a Tiled object class on initialization via `registerTiledObjectClass("Spine", Spine)`
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- minimum melonJS version is now 18.3.0 — required for the Tiled object factory registry that enables placing Spine objects directly in Tiled maps
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- Auto-detect `premultipliedAlpha` from atlas pages and set it on the SkeletonRenderer, fixing incorrect blending for PMA textures (e.g. Cloud Pot)
|
|
24
|
+
|
|
3
25
|
## 2.0.1
|
|
4
26
|
|
|
5
27
|
### Changed
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ A [Spine](http://en.esotericsoftware.com/spine-in-depth) 4.2 runtime integration
|
|
|
30
30
|
## Installation
|
|
31
31
|
-------------------------------------------------------------------------------
|
|
32
32
|
This plugin is already bundled with the required Spine [4.x runtime](package.json#dependencies), so there is no need to install it separately.
|
|
33
|
-
>Note: this plugin requires melonJS version 18.
|
|
33
|
+
>Note: this plugin requires melonJS version 18.3.0 or higher.
|
|
34
34
|
|
|
35
35
|
To install the plugin using npm:
|
|
36
36
|
|
|
@@ -58,8 +58,14 @@ const DataManifest = [
|
|
|
58
58
|
},
|
|
59
59
|
];
|
|
60
60
|
|
|
61
|
+
// create a new Application
|
|
62
|
+
const app = new me.Application(800, 600, {
|
|
63
|
+
parent: "screen",
|
|
64
|
+
renderer: me.video.AUTO,
|
|
65
|
+
});
|
|
66
|
+
|
|
61
67
|
// preload assets
|
|
62
|
-
me.loader.preload(DataManifest,
|
|
68
|
+
me.loader.preload(DataManifest, function() {
|
|
63
69
|
|
|
64
70
|
// create a new Spine Renderable
|
|
65
71
|
let spineAlien = new Spine(100, 100, {atlasFile: "alien.atlas", jsonFile: "alien-ess.json"});
|
|
@@ -68,9 +74,9 @@ me.loader.preload(DataManifest, async function() {
|
|
|
68
74
|
spineAlien.setAnimation(0, "death", true);
|
|
69
75
|
|
|
70
76
|
// add it to the game world
|
|
71
|
-
|
|
77
|
+
app.world.addChild(spineAlien);
|
|
72
78
|
|
|
73
|
-
}
|
|
79
|
+
});
|
|
74
80
|
```
|
|
75
81
|
>Note: use "spine" as a value for the `type` property to indicate which assets are actual Spine assets and to be loaded using the plugin
|
|
76
82
|
|
|
@@ -119,7 +125,9 @@ me.loader.preload(DataManifest, async function() {
|
|
|
119
125
|
|
|
120
126
|
| @melonjs/spine-plugin | melonJS | spine-runtime |
|
|
121
127
|
|---|---|---|
|
|
122
|
-
| v2.0
|
|
128
|
+
| v2.2.0 | v18.3.0 (or higher) | v4.2.x |
|
|
129
|
+
| v2.1.0 | v18.3.0 (or higher) | v4.2.x |
|
|
130
|
+
| v2.0.1 | v18.2.1 (or higher) | v4.2.x |
|
|
123
131
|
| v2.0.0 | v18.2.0 | v4.2.x |
|
|
124
132
|
| v1.5.x | v15.12.x — v18.0.x | v4.1, v4.2-beta |
|
|
125
133
|
|
|
@@ -21,6 +21,12 @@ export default class SkeletonRenderer {
|
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
debugRendering: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether textures use premultiplied alpha
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
premultipliedAlpha: boolean;
|
|
24
30
|
tintColor: MColor;
|
|
25
31
|
tempColor: MColor;
|
|
26
32
|
clipper: SkeletonClipping;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonRenderer.d.ts","sourceRoot":"","sources":["../src/SkeletonRenderer.js"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH;IACC;;;;;;;OAOG;IACH,mBAHU,OAAO,CAGS;IAE1B;;;;OAIG;IACH,gBAHU,OAAO,CAGM;
|
|
1
|
+
{"version":3,"file":"SkeletonRenderer.d.ts","sourceRoot":"","sources":["../src/SkeletonRenderer.js"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH;IACC;;;;;;;OAOG;IACH,mBAHU,OAAO,CAGS;IAE1B;;;;OAIG;IACH,gBAHU,OAAO,CAGM;IAEvB;;;;OAIG;IACH,oBAHU,OAAO,CAGU;IAG3B,kBAAyB;IACzB,kBAAyB;IAGzB,0BAAiC;IACjC,wBAAsB;IACtB,sBAIG;IAEH;;;;OAIG;IACH,eAHW,cAAc,YACd,QAAQ,QAoGlB;IAED;;;;;;;;;;OAUG;IACH,qBATW,cAAc,SACd,gBAAgB,QAChB,IAAI,cACJ,gBAAgB,UAChB,aAAa,QACb,OAAO,GAAC,IAAI,SACZ,OAAO,QAqDjB;IAED;;;;;;;OAOG;IACH,mBANW,cAAc,SACd,gBAAgB,YAChB,YAAY,aACZ,MAAM,EAAE,QA8BlB;IAED;;;OAGG;IACH,wJA2CC;IAED;;;;;;OAMG;IACH,0BALW,IAAI,QACJ,cAAc,cACd,MAAM,QAwChB;CACD;gCA5WuD,SAAS;iCAD1D,8BAA8B;wBACmB,SAAS;iCAD1D,8BAA8B;+BAA9B,8BAA8B"}
|
package/build/Spine.d.ts
CHANGED
|
@@ -49,7 +49,6 @@ export default class Spine extends Renderable {
|
|
|
49
49
|
runtime: typeof spineWebGL | typeof spineCanvas;
|
|
50
50
|
skeleton: any;
|
|
51
51
|
plugin: plugin.BasePlugin;
|
|
52
|
-
renderer: import("melonjs").Renderer;
|
|
53
52
|
animationState: any;
|
|
54
53
|
skeletonRenderer: SkeletonRenderer | spineWebGL.SkeletonRenderer;
|
|
55
54
|
root: any;
|
|
@@ -78,10 +77,9 @@ export default class Spine extends Renderable {
|
|
|
78
77
|
* this.currentTrack.timeScale = 1;
|
|
79
78
|
*/
|
|
80
79
|
currentTrack: TrackEntry;
|
|
81
|
-
|
|
80
|
+
/** @ignore */
|
|
81
|
+
isWebGL: boolean;
|
|
82
82
|
canvas: any;
|
|
83
|
-
context: import("melonjs").Renderer | undefined;
|
|
84
|
-
twoColorTint: boolean | undefined;
|
|
85
83
|
spineBatcher: any;
|
|
86
84
|
shapesShader: spineWebGL.Shader | undefined;
|
|
87
85
|
shapes: spineWebGL.ShapeRenderer | undefined;
|
|
@@ -115,6 +113,7 @@ export default class Spine extends Renderable {
|
|
|
115
113
|
* me.game.world.addChild(spineAlien);
|
|
116
114
|
*/
|
|
117
115
|
setSkeleton(atlasFile: string, jsonFile: string): void;
|
|
116
|
+
premultipliedAlpha: any;
|
|
118
117
|
/**
|
|
119
118
|
* Flip the Spine skeleton on the horizontal axis (around its center).
|
|
120
119
|
* @param {boolean} [flip=true] - `true` to flip this Spine object.
|
|
@@ -141,13 +140,6 @@ export default class Spine extends Renderable {
|
|
|
141
140
|
* @returns {Spine} Reference to this object for method chaining
|
|
142
141
|
*/
|
|
143
142
|
scale(x: number, y?: number): Spine;
|
|
144
|
-
/**
|
|
145
|
-
* Update the bounding box for this spine object.
|
|
146
|
-
* (this will automatically update the bounds of the entire skeleton animation)
|
|
147
|
-
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
148
|
-
* @returns {Bounds} this shape bounding box Rectangle object
|
|
149
|
-
*/
|
|
150
|
-
updateBounds(absolute?: boolean): Bounds;
|
|
151
143
|
/**
|
|
152
144
|
* Draw this Spine object using the appropriate renderer.
|
|
153
145
|
* If WebGL, it uses the melonJS SpineBatcher for two-color tinted rendering.
|
package/build/Spine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spine.d.ts","sourceRoot":"","sources":["../src/Spine.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"Spine.d.ts","sourceRoot":"","sources":["../src/Spine.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH;IAkCC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,eApCW,MAAM,KACN,MAAM,YAEd;QAA0B,SAAS;QACT,QAAQ;QACR,OAAO;KACjC,EA2FF;IAnID,gDAAQ;IACR,cAAS;IACT,0BAAO;IACP,oBAAe;IACf,iEAAiB;IACjB,UAAK;IACL,gCAAW;IACX,8BAAS;IACT;;;MAGE;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACH,cAhBU,UAAU,CAgBP;IAmDZ,cAAc;IACd,iBAAyC;IAIxC,YAA0C;IAK1C,kBAAkD;IASlD,4CAA+D;IAC/D,6CAAyD;IACzD,oEAEC;IAmBF,gBAAsC;IAGrC,6BAAiC;IACjC,8BAAmC;IAcrC,0BANU,OAAO,EAQhB;IAXD;;;;OAIG;IACH,s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;;;;OAkBG;IACH,+BAhBG;QAA4B,KAAK;QACL,SAAS;QACT,GAAG;QACH,OAAO;QACP,QAAQ;QACR,KAAK;KACjC,QAYF;IAED;;;OAGG;IACH,kCAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,qBAFa,MAAM,EAAE,CAMpB;IAED;;;OAGG;IACH,gBAFa,MAAM,EAAE,CAMpB;IAED;;OAEG;IACH,uBAYC;CACD;2BAnrBwC,SAAS;4BADtB,+BAA+B;6BAF9B,gCAAgC;uBAGpB,SAAS;6BACrB,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinePlugin.d.ts","sourceRoot":"","sources":["../src/SpinePlugin.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpinePlugin.d.ts","sourceRoot":"","sources":["../src/SpinePlugin.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH;IACC,cAkBC;IALA,2BAAuD;CAMxD;uBApCgD,SAAS;yBAQjC,gBAAgB"}
|