@tawaship/pixi-animate-runtime 0.1.0 → 0.1.1

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.
@@ -5,7 +5,7 @@ description: Use this skill whenever the user asks to create, edit, or debug con
5
5
 
6
6
  # @tawaship/pixi-animate-runtime development skill
7
7
 
8
- Supported versions: **`^0.1.0`** (written against `0.1.0`).
8
+ Supported versions: **`^0.1.0`** (written against `0.1.1`).
9
9
 
10
10
  First determine the installed version (`node_modules/@tawaship/pixi-animate-runtime/package.json`). If it is outside the supported range, **treat the type definitions in node_modules as authoritative** and follow them wherever they disagree with this skill.
11
11
 
@@ -102,7 +102,7 @@ loadContentAsync({ id: 'COMPOSITION_ID', basepath: 'assets/animates/generated/'
102
102
 
103
103
  - `addCreatejs(instance)` / `addCreatejsAt(instance, index)` put an instance on the container; a movie clip plays from its first frame. `removeCreatejs(instance)` takes it off and it stops
104
104
  - Content plays at its published frame rate whatever the display's refresh rate
105
- - `speed`: playback speed (`1` = published frame rate, `0` stops)
105
+ - `speed`: playback speed (`1` = published frame rate, `0` stops; a value below `0` is taken as `0`, nothing plays backward)
106
106
  - `overSpeed` (default `true`): when the display runs slower than the content, one tick may play several frames. `false` plays at most one frame per tick
107
107
  - `smooth` (default `true`): frames follow a steady clock, so small variations of the frame time do not make the playing uneven (no frame on one tick, two on the next); it still keeps to the real time. Leave it on unless the user asks for the pixi-animate-container behavior (`false`)
108
108
  - To play on a container of another PixiJS framework, use `new AnimateController(container)`; it has the same `addCreatejs`, `handleTick`, `speed`, `overSpeed`, `smooth`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tawaship/pixi-animate-runtime",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Plays Adobe Animate HTML5 Canvas content on PixiJS from definitions extracted by @tawaship/animate-data-converter.",
5
5
  "main": "dist/pixi-animate-runtime.cjs.js",
6
6
  "module": "dist/pixi-animate-runtime.esm.js",
@@ -18,7 +18,7 @@ import { DisplayObject } from './display';
18
18
  * on only settles it on its first frame.
19
19
  */
20
20
  export declare class AnimateController {
21
- /** Playback speed (1 is the content's own frame rate) */
21
+ /** Playback speed (1 is the content's own frame rate, 0 stops; a value below 0 is taken as 0) */
22
22
  speed: number;
23
23
  /** Whether one call may play more than one frame (when the display runs slower than the content) */
24
24
  overSpeed: boolean;
@@ -32,6 +32,8 @@ export declare class AnimateController {
32
32
  private _nextDelta;
33
33
  /** @param container The container the roots are put on */
34
34
  constructor(container: PIXI.Container);
35
+ /** Settles the roots marked by a goto since they were last resolved */
36
+ private _settleForDrawing;
35
37
  handleTick(delta: number): void;
36
38
  /** Records a delta and gives the median of the latest ones */
37
39
  private _usualDelta;
@@ -54,7 +56,7 @@ export declare class AnimateController {
54
56
  */
55
57
  export declare class AnimateContainer extends PIXI.Container {
56
58
  private readonly _controller;
57
- /** Playback speed (1 is the content's own frame rate) */
59
+ /** Playback speed (1 is the content's own frame rate, 0 stops; a value below 0 is taken as 0) */
58
60
  get speed(): number;
59
61
  set speed(value: number);
60
62
  /** Whether one call may play more than one frame (when the display runs slower than the content) */
@@ -167,4 +167,15 @@ export declare function tick(root: DisplayObject, event?: Event): void;
167
167
  * reverse order), without playing a frame.
168
168
  */
169
169
  export declare function resolveState(node: DisplayObject): void;
170
+ /**
171
+ * Settles a display tree for drawing without playing it on, as a createjs
172
+ * stage draw shows it (MovieClip.draw settles each clip): the synched and
173
+ * single frame clips are placed at the frame their parent gives, and a clip
174
+ * waiting to start over (an independent clip reset when its parent placed it
175
+ * again) is shown at its first frame the way a new clip is (no frame script,
176
+ * its playhead left to start on the next frame, as in the template, where
177
+ * createjs draws only after a frame). Children after their parent, in reverse
178
+ * order as the resolve phase.
179
+ */
180
+ export declare function settleForDrawing(node: DisplayObject): void;
170
181
  export {};
@@ -69,6 +69,12 @@ export declare class DisplayObject extends EventDispatcher {
69
69
  _maskHost: Container | null;
70
70
  /** The objects this object masks (while they are on a display list) */
71
71
  _maskTargets: DisplayObject[];
72
+ /**
73
+ * Set on a root when a timeline under it jumped outside the playing (a goto):
74
+ * its clips are to be settled before Pixi draws it (settleForDrawing), as a
75
+ * createjs draw would. The resolve phase of a frame clears it
76
+ */
77
+ _pendingResolve: boolean;
72
78
  constructor(pixi: IOwnedNode);
73
79
  get _eventParent(): EventDispatcher | null;
74
80
  private get _transform();