@rive-app/webgl-single 2.12.0 → 2.12.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/package.json +1 -1
- package/rive.d.ts +21 -1
- package/rive.js +40 -15
- package/rive.js.map +1 -1
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export type { FileAsset, FontAsset, ImageAsset } from './rive_advanced.mjs';
|
|
|
5
5
|
*/
|
|
6
6
|
export type VoidCallback = () => void;
|
|
7
7
|
export type AssetLoadCallback = (asset: rc.FileAsset, bytes: Uint8Array) => Boolean;
|
|
8
|
+
interface SetupRiveListenersOptions {
|
|
9
|
+
isTouchScrollEnabled?: boolean;
|
|
10
|
+
}
|
|
8
11
|
/**
|
|
9
12
|
* Type for artboard bounds
|
|
10
13
|
*/
|
|
@@ -202,6 +205,12 @@ export interface RiveParameters {
|
|
|
202
205
|
* will be attached to the <canvas> element
|
|
203
206
|
*/
|
|
204
207
|
shouldDisableRiveListeners?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* For Rive Listeners, allows scrolling behavior to still occur on canvas elements
|
|
210
|
+
* when a touch/drag action is performed on touch-enabled devices. Otherwise,
|
|
211
|
+
* scroll behavior may be prevented on touch/drag actions on the canvas by default.
|
|
212
|
+
*/
|
|
213
|
+
isTouchScrollEnabled?: boolean;
|
|
205
214
|
/**
|
|
206
215
|
* Enable Rive Events to be handled by the runtime. This means any special Rive Event may have
|
|
207
216
|
* a side effect that takes place implicitly.
|
|
@@ -298,10 +307,21 @@ export declare class Rive {
|
|
|
298
307
|
durations: number[];
|
|
299
308
|
frameTimes: number[];
|
|
300
309
|
frameCount: number;
|
|
310
|
+
isTouchScrollEnabled: boolean;
|
|
301
311
|
constructor(params: RiveParameters);
|
|
302
312
|
static new(params: RiveParameters): Rive;
|
|
303
313
|
private init;
|
|
304
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Setup Rive Listeners on the canvas
|
|
316
|
+
* @param riveListenerOptions - Enables TouchEvent events on the canvas. Set to true to allow
|
|
317
|
+
* touch scrolling on the canvas element on touch-enabled devices
|
|
318
|
+
* i.e. { isTouchScrollEnabled: true }
|
|
319
|
+
*/
|
|
320
|
+
setupRiveListeners(riveListenerOptions?: SetupRiveListenersOptions): void;
|
|
321
|
+
/**
|
|
322
|
+
* Remove Rive Listeners setup on the canvas
|
|
323
|
+
*/
|
|
324
|
+
removeRiveListeners(): void;
|
|
305
325
|
private initData;
|
|
306
326
|
private initArtboard;
|
|
307
327
|
drawFrame(): void;
|