spine-html 1.25.0 → 1.27.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/NOTICE.md CHANGED
@@ -6,7 +6,7 @@
6
6
  `@rig-c/play` (or of `rig-play` or `spine-html`, the same files under the names the
7
7
  package shipped as before) carries one JavaScript module, `dist/index.js`, plus type
8
8
  declarations, and that module bundles two things: the renderer, and
9
- `rig-c/core` (MIT), rigc's own posing core, which poses the compiled model
9
+ `@rig-c/core/core` and `@rig-c/core/runtime` (MIT), rigc's own posing core, which poses the compiled model
10
10
  document `rigc build` writes. No part of the
11
11
  [Spine Runtimes](https://github.com/EsotericSoftware/spine-runtimes) is in it,
12
12
  imported by it, or required beside it.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/rig-c/play/main/assets/banner.svg" alt="@rig-c/play — Plays rig-c's compiled model as plain DOM elements or one canvas" width="100%" />
2
+ <img src="assets/banner.svg" alt="@rig-c/play — Plays rig-c's compiled model as plain DOM elements or one canvas" width="100%" />
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -14,8 +14,8 @@
14
14
  compiled model document `rigc build` writes, `skeleton.model.json` — as **plain
15
15
  DOM**: one absolutely-positioned `<img>` per rigid slot, posed with a single CSS
16
16
  `matrix()` write per frame, and deforming meshes on small per-part canvases; or
17
- as **one canvas** per player. It poses through rigc's bundled `rig-c/runtime`
18
- and `rig-c/core`, and links nothing from Esoteric Software.
17
+ as **one canvas** per player. It poses through rigc's bundled `@rig-c/core/runtime`
18
+ and `@rig-c/core/core`, and links nothing from Esoteric Software.
19
19
  `rig-play` is the convenience install name; `spine-html` is the legacy install name.
20
20
  The compiler is [@rig-c/core](https://github.com/rig-c/core) (npm `@rig-c/core`)
21
21
  and the part generator [rig-c/parts](https://github.com/rig-c/parts).
@@ -32,7 +32,7 @@ the blockers named were meshes, clipping and DOM update overhead, and the 0.x li
32
32
  answered each of them (per-part mesh canvases, element-level `clip-path`, dirty-skip).
33
33
 
34
34
  At 1.0 it stopped being a Spine runtime. It plays the model document `rigc build` writes,
35
- poses it through `rig-c/core` — rigc's own posing core, bundled into the package — and
35
+ poses it through `@rig-c/core/core` — rigc's own posing core, bundled into the package — and
36
36
  links nothing from Esoteric Software; a Spine export is refused by name. It gained a
37
37
  second render mode that draws the whole frame into one canvas. And it took the name
38
38
  `rig-play`, which says what it is; after 1.8 it moved with the rest of the toolchain to
@@ -41,7 +41,7 @@ links to either earlier name keep working.
41
41
 
42
42
  ### Measured
43
43
 
44
- The [standing comparison and its conditions](https://github.com/rig-c/play/blob/main/docs/BENCHMARK.md#measured) record these tradeoffs:
44
+ The [standing comparison and its conditions](docs/BENCHMARK.md#measured) record these tradeoffs:
45
45
 
46
46
  | scene | observation in that comparison |
47
47
  | --- | --- |
@@ -63,7 +63,7 @@ The package plays rigs built by [rigc](https://github.com/rig-c/core):
63
63
  is what the player loads, and it states everything posing and drawing need —
64
64
  the skeleton, the animations, and where every region sits on its page — so the
65
65
  `.atlas` and `skeleton.json` beside it are not fetched. Poses are computed by
66
- the bundled `rig-c/runtime` and `rig-c/core`: there is nothing else to install.
66
+ the bundled `@rig-c/core/runtime` and `@rig-c/core/core`: there is nothing else to install.
67
67
 
68
68
  ```ts
69
69
  import { loadModel, RigPlayer } from '@rig-c/play';
@@ -130,23 +130,40 @@ package built from this tree.
130
130
 
131
131
  ## Where to read next
132
132
 
133
- - [docs/REFERENCE.md](https://github.com/rig-c/play/blob/main/docs/REFERENCE.md) — what the player does once it is on
133
+ - [docs/REFERENCE.md](docs/REFERENCE.md) — what the player does once it is on
134
134
  the page: what ships and what is measured (*Status*), then every API section
135
135
  from wind, gravity and dragging to the runtime knobs and what they cost.
136
136
  `physicsMoved(scope, motion)` supplies apparent world movement to named bone,
137
137
  subtree or constraint physics; `moved()` continues to report whole-rig motion.
138
138
  See the reference for explicit pivots, units and evaluation/history limits.
139
- - [docs/MIGRATION.md](https://github.com/rig-c/play/blob/main/docs/MIGRATION.md) — adding live-frame consumers, coming
139
+ In the reference, by task:
140
+ - Blow wind on the rig's physics, change gravity, or tell it the page dragged
141
+ it: `environment()` and `moved()`, in
142
+ [Wind, gravity and dragging the rig](docs/REFERENCE.md#wind-gravity-and-dragging-the-rig).
143
+ - Jump to a time, with the wind and gravity that led up to it:
144
+ `seek(time, environmentAt)`, in the same section.
145
+ - Switch an outfit, an expression or a mouth shape by name: `setSet(name)`, in
146
+ [Attachment sets](docs/REFERENCE.md#attachment-sets-setsjson).
147
+ - Layer one animation over another, with a weight or additively: tracks, in
148
+ [Several tracks](docs/REFERENCE.md#several-tracks).
149
+ - Drive a bone yourself while an animation plays:
150
+ [Adjusting bones](docs/REFERENCE.md#adjusting-bones).
151
+ - Find out why a renderer is not drawing through WebGL:
152
+ `backendFallbackReason`, in
153
+ [Runtime knobs and what they cost](docs/REFERENCE.md#runtime-knobs-and-what-they-cost).
154
+ - Let the pointer move the camera over a composed take: `camera: 'parallax'`, in
155
+ [Pointer camera for a composed take](docs/REFERENCE.md#pointer-camera-for-a-composed-take).
156
+ - [docs/MIGRATION.md](docs/MIGRATION.md) — adding live-frame consumers, coming
140
157
  from 1.8 (meshes draw through WebGL by default since 1.9) and from `spine-html`
141
158
  0.8 (the 0.8 → 1.0 table, what has no counterpart, before and after).
142
- - [docs/TESTING.md](https://github.com/rig-c/play/blob/main/docs/TESTING.md) — how the suite holds the picture: the two
159
+ - [docs/TESTING.md](docs/TESTING.md) — how the suite holds the picture: the two
143
160
  render modes' parity, the clipping oracle, the loading harness, and the
144
161
  independent official raster oracle.
145
- - [docs/BENCHMARK.md](https://github.com/rig-c/play/blob/main/docs/BENCHMARK.md) — the readings behind *Measured*, and
162
+ - [docs/BENCHMARK.md](docs/BENCHMARK.md) — the readings behind *Measured*, and
146
163
  the bench that produces them: scenes, framing, and what a headless number is
147
164
  not evidence of.
148
- - [CHANGELOG.md](https://github.com/rig-c/play/blob/main/CHANGELOG.md) — what each version changed;
149
- [RELEASING.md](https://github.com/rig-c/play/blob/main/RELEASING.md) — how a version is cut.
165
+ - [CHANGELOG.md](CHANGELOG.md) — what each version changed;
166
+ [RELEASING.md](RELEASING.md) — how a version is cut.
150
167
  - [`skills/rig-play/SKILL.md`](skills/rig-play/SKILL.md) — the agent skill that routes a web-page playback or live-frame request to the guides above.
151
168
 
152
169
  ## Demo (this repository)
@@ -175,11 +192,11 @@ deterministic captures.
175
192
 
176
193
  ## How it works
177
194
 
178
- `loadModel` reads the rig's compiled model document (`rig-c/core`'s `readModel`).
179
- With the default `poser: 'auto'`, `RigPlayer` uses `rig-c/runtime`'s
195
+ `loadModel` reads the rig's compiled model document (`@rig-c/core/core`'s `readModel`).
196
+ With the default `poser: 'auto'`, `RigPlayer` uses `@rig-c/core/runtime`'s
180
197
  `compileRuntime` and `RuntimePose` for covered models and animations, drawing
181
198
  from a borrowed `LiveFrame` exposed by `player.liveFrame()`. Features and
182
- operations outside that path's coverage use the `rig-c/core` oracle —
199
+ operations outside that path's coverage use the `@rig-c/core/core` oracle —
183
200
  `openTrack` for a single track, `openTracks` for track composition. Models with
184
201
  physics constraints stay on that oracle path. `player.poser` reports `"runtime"` or
185
202
  `"oracle: <reason>"`; `poser: 'oracle'` selects the oracle explicitly. Posing
@@ -187,7 +204,7 @@ stays CPU-side and renderer-agnostic, advancing one `dt` at a time.
187
204
  Both renderers accept a borrowed `LiveFrame` or a detached `PosedFrame`.
188
205
  `player.posedFrame()` returns a snapshot that survives later pose mutations;
189
206
  a live frame is valid only until the next pose mutation. See
190
- [Borrowing a live frame](https://github.com/rig-c/play/blob/main/docs/REFERENCE.md#borrowing-a-live-frame) for the
207
+ [Borrowing a live frame](docs/REFERENCE.md#borrowing-a-live-frame) for the
191
208
  buffer layout, lifetime and fallback policy.
192
209
  At load time each region of the document's `pages` section is cut into its own
193
210
  bitmap (rotation restored), one blob URL per region — except regions that
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasRenderer.d.ts","sourceRoot":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