stage-js 1.0.1 → 1.0.2
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/dist/stage.d.ts +31 -15
- package/dist/stage.js +160 -106
- package/dist/stage.js.map +1 -1
- package/dist/stage.umd.cjs +162 -108
- package/dist/stage.umd.cjs.map +1 -1
- package/package.json +13 -10
- package/src/core/component.ts +52 -10
- package/src/core/debug.ts +33 -0
- package/src/core/easing.ts +1 -1
- package/src/core/pin.ts +60 -10
- package/src/core/pointer.ts +6 -0
- package/src/core/root.ts +25 -72
package/dist/stage.d.ts
CHANGED
|
@@ -205,11 +205,11 @@ export interface SetPinType {
|
|
|
205
205
|
skewX?: number;
|
|
206
206
|
skewY?: number;
|
|
207
207
|
rotation?: number;
|
|
208
|
-
/** Center of scale/skew/rotate */
|
|
208
|
+
/** Center of scale/skew/rotate, 0 is start, 1 is end */
|
|
209
209
|
pivot?: number;
|
|
210
|
-
/** Center of scale/skew/rotate */
|
|
210
|
+
/** Center of scale/skew/rotate, 0 is start, 1 is end */
|
|
211
211
|
pivotX?: number;
|
|
212
|
-
/** Center of scale/skew/rotate */
|
|
212
|
+
/** Center of scale/skew/rotate, 0 is start, 1 is end */
|
|
213
213
|
pivotY?: number;
|
|
214
214
|
/** Offset in parent coordination */
|
|
215
215
|
offset?: number;
|
|
@@ -217,17 +217,17 @@ export interface SetPinType {
|
|
|
217
217
|
offsetX?: number;
|
|
218
218
|
/** Offset in parent coordination */
|
|
219
219
|
offsetY?: number;
|
|
220
|
-
/** A point on parent where this component is offset from, 0 is
|
|
220
|
+
/** A point on parent where this component is offset from, 0 is start, 1 is end */
|
|
221
221
|
align?: number;
|
|
222
|
-
/** A point on parent where this component is offset from, 0 is
|
|
222
|
+
/** A point on parent where this component is offset from, 0 is start, 1 is end */
|
|
223
223
|
alignX?: number;
|
|
224
|
-
/** A point on parent where this component is offset from, 0 is
|
|
224
|
+
/** A point on parent where this component is offset from, 0 is start, 1 is end */
|
|
225
225
|
alignY?: number;
|
|
226
|
-
/** A point on this component which is offset from parent, 0 is
|
|
226
|
+
/** A point on this component which is offset from parent, 0 is start, 1 is end */
|
|
227
227
|
handle?: number;
|
|
228
|
-
/** A point on this component which is offset from parent, 0 is
|
|
228
|
+
/** A point on this component which is offset from parent, 0 is start, 1 is end */
|
|
229
229
|
handleX?: number;
|
|
230
|
-
/** A point on this component which is offset from parent, 0 is
|
|
230
|
+
/** A point on this component which is offset from parent, 0 is start, 1 is end */
|
|
231
231
|
handleY?: number;
|
|
232
232
|
/** @hidden @deprecated Use component.fit() */
|
|
233
233
|
resizeMode?: FitMode;
|
|
@@ -333,13 +333,23 @@ export declare function minimize(): Component;
|
|
|
333
333
|
export declare function maximize(): Component;
|
|
334
334
|
export declare class Component {
|
|
335
335
|
MAX_ELAPSE: number;
|
|
336
|
+
/** @hidden Set to true to enable debug rendering */
|
|
337
|
+
_debug: boolean;
|
|
336
338
|
constructor();
|
|
337
339
|
matrix(relative?: boolean): Matrix;
|
|
338
|
-
/** @hidden @deprecated */
|
|
340
|
+
/** @hidden @deprecated Use getLogicalPixelRatio */
|
|
339
341
|
getPixelRatio(): number;
|
|
340
|
-
/**
|
|
342
|
+
/**
|
|
343
|
+
* @hidden
|
|
344
|
+
* Physical-pixel per unit of parent component.
|
|
345
|
+
* This is not accurate before first tick.
|
|
346
|
+
*/
|
|
341
347
|
getDevicePixelRatio(): number;
|
|
342
|
-
/**
|
|
348
|
+
/**
|
|
349
|
+
* @hidden
|
|
350
|
+
* Logical-pixel per unit of parent component.
|
|
351
|
+
* This is not accurate before first tick.
|
|
352
|
+
*/
|
|
343
353
|
getLogicalPixelRatio(): number;
|
|
344
354
|
pin(key: GetPinKeys): any;
|
|
345
355
|
pin(key: SetPinKeys, value: any): this;
|
|
@@ -442,6 +452,7 @@ export declare class Component {
|
|
|
442
452
|
* Set cell spacing for row and column layout.
|
|
443
453
|
*/
|
|
444
454
|
spacing(space: number): this;
|
|
455
|
+
renderDebug(ctx: CanvasRenderingContext2D, xf: Matrix): void;
|
|
445
456
|
}
|
|
446
457
|
export declare function sprite(frame?: TextureSelectionInput): Sprite;
|
|
447
458
|
export declare class Sprite extends Component {
|
|
@@ -519,6 +530,11 @@ export declare const POINTER_CANCEL = "touchcancel mousecancel";
|
|
|
519
530
|
export declare const POINTER_START = "touchstart mousedown";
|
|
520
531
|
/** @hidden @deprecated */
|
|
521
532
|
export declare const POINTER_END = "touchend mouseup";
|
|
533
|
+
interface PointerEvent$1 {
|
|
534
|
+
x: number;
|
|
535
|
+
y: number;
|
|
536
|
+
raw: UIEvent;
|
|
537
|
+
}
|
|
522
538
|
export declare function pause(): void;
|
|
523
539
|
export declare function resume(): void;
|
|
524
540
|
export declare function mount(configs?: RootConfig): Root;
|
|
@@ -553,9 +569,7 @@ export declare class Root extends Component {
|
|
|
553
569
|
constructor();
|
|
554
570
|
mount: (configs?: RootConfig) => void;
|
|
555
571
|
resizeCanvas(): void;
|
|
556
|
-
|
|
557
|
-
debugDrawAxis: number;
|
|
558
|
-
private renderDebug;
|
|
572
|
+
renderDebug(ctx: CanvasRenderingContext2D, m: Matrix): void;
|
|
559
573
|
resume(): this;
|
|
560
574
|
pause(): this;
|
|
561
575
|
unmount(): this;
|
|
@@ -574,6 +588,7 @@ export declare class Root extends Component {
|
|
|
574
588
|
*/
|
|
575
589
|
viewbox(viewbox: Viewbox): this;
|
|
576
590
|
viewbox(width?: number, height?: number, mode?: FitMode): this;
|
|
591
|
+
/** @hidden */
|
|
577
592
|
camera(matrix: Matrix): this;
|
|
578
593
|
/** @hidden */
|
|
579
594
|
flipX(x: boolean): this;
|
|
@@ -612,6 +627,7 @@ export declare class Monotype extends Component {
|
|
|
612
627
|
export {
|
|
613
628
|
Component as Node,
|
|
614
629
|
Monotype as Str,
|
|
630
|
+
PointerEvent$1 as PointerEvent,
|
|
615
631
|
Sprite as Image,
|
|
616
632
|
monotype as string,
|
|
617
633
|
sprite as image,
|