@rive-app/webgl-single 2.22.0 → 2.23.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/package.json +1 -1
- package/rive.d.ts +46 -2
- package/rive.js +120 -15
- package/rive.js.map +1 -1
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -357,6 +357,8 @@ export declare class Rive {
|
|
|
357
357
|
private automaticallyHandleEvents;
|
|
358
358
|
private enableRiveAssetCDN;
|
|
359
359
|
private _volume;
|
|
360
|
+
private _artboardWidth;
|
|
361
|
+
private _artboardHeight;
|
|
360
362
|
private _devicePixelRatioUsed;
|
|
361
363
|
private _hasZeroSize;
|
|
362
364
|
durations: number[];
|
|
@@ -384,6 +386,7 @@ export declare class Rive {
|
|
|
384
386
|
* we hook the instance to the audio manager
|
|
385
387
|
*/
|
|
386
388
|
private initializeAudio;
|
|
389
|
+
private initArtboardSize;
|
|
387
390
|
private initData;
|
|
388
391
|
private initArtboard;
|
|
389
392
|
drawFrame(): void;
|
|
@@ -479,7 +482,12 @@ export declare class Rive {
|
|
|
479
482
|
* Accounts for devicePixelRatio as a multiplier to render the size of the canvas drawing surface.
|
|
480
483
|
* Uses the size of the backing canvas to set new width/height attributes. Need to re-render
|
|
481
484
|
* and resize the layout to match the new drawing surface afterwards.
|
|
482
|
-
* Useful function for consumers to include in a window resize listener
|
|
485
|
+
* Useful function for consumers to include in a window resize listener.
|
|
486
|
+
*
|
|
487
|
+
* This method will set the {@link devicePixelRatioUsed} property.
|
|
488
|
+
*
|
|
489
|
+
* Optionally, you can provide a {@link customDevicePixelRatio} to provide a
|
|
490
|
+
* custom value.
|
|
483
491
|
*/
|
|
484
492
|
resizeDrawingSurfaceToCanvas(customDevicePixelRatio?: number): void;
|
|
485
493
|
get source(): string;
|
|
@@ -647,10 +655,46 @@ export declare class Rive {
|
|
|
647
655
|
*/
|
|
648
656
|
get contents(): RiveFileContents;
|
|
649
657
|
/**
|
|
650
|
-
*
|
|
658
|
+
* Getter / Setter for the volume of the artboard
|
|
651
659
|
*/
|
|
652
660
|
get volume(): number;
|
|
653
661
|
set volume(value: number);
|
|
662
|
+
/**
|
|
663
|
+
* The width of the artboard.
|
|
664
|
+
*
|
|
665
|
+
* This will return undefined if the artboard is not loaded yet and a custom
|
|
666
|
+
* width has not been set.
|
|
667
|
+
*
|
|
668
|
+
* Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}
|
|
669
|
+
* with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard width is
|
|
670
|
+
* automatically set.
|
|
671
|
+
*/
|
|
672
|
+
get artboardWidth(): number | undefined;
|
|
673
|
+
set artboardWidth(value: number);
|
|
674
|
+
/**
|
|
675
|
+
* The height of the artboard.
|
|
676
|
+
*
|
|
677
|
+
* This will return undefined if the artboard is not loaded yet and a custom
|
|
678
|
+
* height has not been set.
|
|
679
|
+
*
|
|
680
|
+
* Do not set this value manually when using {@link resizeDrawingSurfaceToCanvas}
|
|
681
|
+
* with a {@link Layout.fit} of {@link Fit.Layout}, as the artboard height is
|
|
682
|
+
* automatically set.
|
|
683
|
+
*/
|
|
684
|
+
get artboardHeight(): number | undefined;
|
|
685
|
+
set artboardHeight(value: number);
|
|
686
|
+
/**
|
|
687
|
+
* Reset the artboard size to its original values.
|
|
688
|
+
*/
|
|
689
|
+
resetArtboardSize(): void;
|
|
690
|
+
/**
|
|
691
|
+
* The device pixel ratio used in rendering and canvas/artboard resizing.
|
|
692
|
+
*
|
|
693
|
+
* This value will be overidden by the device pixel ratio used in
|
|
694
|
+
* {@link resizeDrawingSurfaceToCanvas}. If you use that method, do not set this value.
|
|
695
|
+
*/
|
|
696
|
+
get devicePixelRatioUsed(): number;
|
|
697
|
+
set devicePixelRatioUsed(value: number);
|
|
654
698
|
}
|
|
655
699
|
/**
|
|
656
700
|
* Contents of a state machine input
|