Skip to content

Commit e87fc16

Browse files
obiotclaude
andauthored
Update spine-plugin README: Application pattern, v2.1.0 compat table (#1360)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2f42bbb commit e87fc16

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

packages/spine-plugin/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- 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)`
77

88
### Changed
9-
- minimum melonJS version is now 18.3.0 (Tiled object factory registry)
9+
- minimum melonJS version is now 18.3.0 — required for the Tiled object factory registry that enables placing Spine objects directly in Tiled maps
1010

1111
### Fixed
1212
- Auto-detect `premultipliedAlpha` from atlas pages and set it on the SkeletonRenderer, fixing incorrect blending for PMA textures (e.g. Cloud Pot)

packages/spine-plugin/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ A [Spine](http://en.esotericsoftware.com/spine-in-depth) 4.2 runtime integration
3030
## Installation
3131
-------------------------------------------------------------------------------
3232
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.2.1 or higher.
33+
>Note: this plugin requires melonJS version 18.3.0 or higher.
3434
3535
To install the plugin using npm:
3636

@@ -58,8 +58,14 @@ const DataManifest = [
5858
},
5959
];
6060

61+
// create a new Application
62+
const app = new me.Application(800, 600, {
63+
parent: "screen",
64+
renderer: me.video.AUTO,
65+
});
66+
6167
// preload assets
62-
me.loader.preload(DataManifest, async function() {
68+
me.loader.preload(DataManifest, function() {
6369

6470
// create a new Spine Renderable
6571
let spineAlien = new Spine(100, 100, {atlasFile: "alien.atlas", jsonFile: "alien-ess.json"});
@@ -68,9 +74,9 @@ me.loader.preload(DataManifest, async function() {
6874
spineAlien.setAnimation(0, "death", true);
6975

7076
// add it to the game world
71-
me.game.world.addChild(spineAlien);
77+
app.world.addChild(spineAlien);
7278

73-
}
79+
});
7480
```
7581
>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
7682
@@ -119,7 +125,8 @@ me.loader.preload(DataManifest, async function() {
119125

120126
| @melonjs/spine-plugin | melonJS | spine-runtime |
121127
|---|---|---|
122-
| v2.0.1+ | v18.2.1 (or higher) | v4.2.x |
128+
| v2.1.0 | v18.3.0 (or higher) | v4.2.x |
129+
| v2.0.1 | v18.2.1 (or higher) | v4.2.x |
123130
| v2.0.0 | v18.2.0 | v4.2.x |
124131
| v1.5.x | v15.12.x — v18.0.x | v4.1, v4.2-beta |
125132

0 commit comments

Comments
 (0)