@rive-app/webgl-single 1.0.24 → 1.0.25
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 +2 -0
- package/rive.js +4 -3
- package/rive.js.map +1 -1
- package/rive_advanced.mjs.d.ts +1 -1
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -178,6 +178,7 @@ export interface RiveParameters {
|
|
|
178
178
|
stateMachines?: string | string[];
|
|
179
179
|
layout?: Layout;
|
|
180
180
|
autoplay?: boolean;
|
|
181
|
+
useOffscreenRenderer?: boolean;
|
|
181
182
|
onLoad?: EventCallback;
|
|
182
183
|
onLoadError?: EventCallback;
|
|
183
184
|
onPlay?: EventCallback;
|
|
@@ -221,6 +222,7 @@ export interface RiveLoadParameters {
|
|
|
221
222
|
artboard?: string;
|
|
222
223
|
animations?: string | string[];
|
|
223
224
|
stateMachines?: string | string[];
|
|
225
|
+
useOffscreenRenderer?: boolean;
|
|
224
226
|
}
|
|
225
227
|
export interface RiveResetParameters {
|
|
226
228
|
artboard?: string;
|
package/rive.js
CHANGED
|
@@ -169,7 +169,7 @@ k.run=sd;if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);
|
|
|
169
169
|
/* 2 */
|
|
170
170
|
/***/ ((module) => {
|
|
171
171
|
|
|
172
|
-
module.exports = JSON.parse('{"name":"@rive-app/webgl-single","version":"1.0.
|
|
172
|
+
module.exports = JSON.parse('{"name":"@rive-app/webgl-single","version":"1.0.25","description":"Rive\'s webgl based web api with bundled wasm.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
173
173
|
|
|
174
174
|
/***/ })
|
|
175
175
|
/******/ ]);
|
|
@@ -1117,6 +1117,7 @@ var Rive = /** @class */ (function () {
|
|
|
1117
1117
|
animations: params.animations,
|
|
1118
1118
|
stateMachines: params.stateMachines,
|
|
1119
1119
|
artboard: params.artboard,
|
|
1120
|
+
useOffscreenRenderer: params.useOffscreenRenderer,
|
|
1120
1121
|
});
|
|
1121
1122
|
}
|
|
1122
1123
|
// Alternative constructor to build a Rive instance from an interface/object
|
|
@@ -1127,7 +1128,7 @@ var Rive = /** @class */ (function () {
|
|
|
1127
1128
|
// Initializes the Rive object either from constructor or load()
|
|
1128
1129
|
Rive.prototype.init = function (_a) {
|
|
1129
1130
|
var _this = this;
|
|
1130
|
-
var src = _a.src, buffer = _a.buffer, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b;
|
|
1131
|
+
var src = _a.src, buffer = _a.buffer, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c;
|
|
1131
1132
|
this.src = src;
|
|
1132
1133
|
this.buffer = buffer;
|
|
1133
1134
|
// If no source file url specified, it's a bust
|
|
@@ -1145,7 +1146,7 @@ var Rive = /** @class */ (function () {
|
|
|
1145
1146
|
RuntimeLoader.awaitInstance().then(function (runtime) {
|
|
1146
1147
|
_this.runtime = runtime;
|
|
1147
1148
|
// Get the canvas where you want to render the animation and create a renderer
|
|
1148
|
-
_this.renderer = _this.runtime.makeRenderer(_this.canvas);
|
|
1149
|
+
_this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
|
|
1149
1150
|
// Initial size adjustment based on devicePixelRatio if no width/height are specified explicitly
|
|
1150
1151
|
if (!(_this.canvas.width || _this.canvas.height)) {
|
|
1151
1152
|
_this.resizeDrawingSurfaceToCanvas();
|