@rive-app/canvas-advanced-single 2.44.2 → 2.45.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/canvas_advanced_single.mjs +1 -1
- package/package.json +1 -1
- package/rive_advanced.mjs.d.ts +19 -0
package/package.json
CHANGED
package/rive_advanced.mjs.d.ts
CHANGED
|
@@ -88,11 +88,13 @@ export interface RiveCanvas {
|
|
|
88
88
|
* This uses an offscreen renderer to draw on the canvas, allowing for multiple Rives/canvases on
|
|
89
89
|
* a given screen. It is highly recommended to set this to `true` when using with the
|
|
90
90
|
* `@rive-app/webgl` package
|
|
91
|
+
* @param options - Renderer creation options
|
|
91
92
|
* @returns A Rive CanvasRenderer (Canvas2D) or Renderer (WebGL) class
|
|
92
93
|
*/
|
|
93
94
|
makeRenderer(
|
|
94
95
|
canvas: HTMLCanvasElement | OffscreenCanvas,
|
|
95
96
|
useOffscreenRenderer?: boolean,
|
|
97
|
+
options?: RendererOptions,
|
|
96
98
|
): WrappedRenderer;
|
|
97
99
|
|
|
98
100
|
/**
|
|
@@ -129,6 +131,7 @@ export interface RiveCanvas {
|
|
|
129
131
|
cancelAnimationFrame(requestID: number): void;
|
|
130
132
|
/**
|
|
131
133
|
* A Rive-specific function to "flush" queued up draw calls from using the renderer.
|
|
134
|
+
* It also ends the frame for scripts, which collect their memory then.
|
|
132
135
|
*
|
|
133
136
|
* This should only be invoked once at the end of a loop in a regular JS
|
|
134
137
|
* requestAnimationFrame loop, and should not be used with the Rive-wrapped
|
|
@@ -183,6 +186,15 @@ export declare class DeferredSession {
|
|
|
183
186
|
recordedThisFrame(): boolean;
|
|
184
187
|
}
|
|
185
188
|
|
|
189
|
+
export interface RendererOptions {
|
|
190
|
+
/**
|
|
191
|
+
* @experimental (WebGL2 only) Renders with inkbleed antialiasing instead of MSAA, which
|
|
192
|
+
* disables the canvas's native MSAA. Fills that don't use the clockwise fill rule are
|
|
193
|
+
* converted to clockwise on a best-effort basis
|
|
194
|
+
*/
|
|
195
|
+
inkbleed?: boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
186
198
|
/**
|
|
187
199
|
* Rive wrapper around a rendering context for a canvas element, implementing a subset of the APIs
|
|
188
200
|
* from the rendering context interface
|
|
@@ -248,6 +260,13 @@ export declare class RendererWrapper {
|
|
|
248
260
|
* @experimental Whether a deferred session is currently attached.
|
|
249
261
|
*/
|
|
250
262
|
deferredActive?(): boolean;
|
|
263
|
+
/**
|
|
264
|
+
* @experimental (WebGL2 only) Toggles inkbleed antialiasing. Absent on renderers that
|
|
265
|
+
* cannot inkbleed (an offscreen renderer, or a non-WebGL2 build).
|
|
266
|
+
*
|
|
267
|
+
* @returns false if inkbleed was requested but the canvas context does not support it
|
|
268
|
+
*/
|
|
269
|
+
setInkbleed?(enabled: boolean): boolean;
|
|
251
270
|
}
|
|
252
271
|
|
|
253
272
|
export declare class RenderPathWrapper {
|