@rive-app/canvas
Advanced tools
Comparing version 1.1.10 to 1.2.0
{ | ||
"name": "@rive-app/canvas", | ||
"version": "1.1.10", | ||
"version": "1.2.0", | ||
"description": "Rive's canvas based web api.", | ||
@@ -5,0 +5,0 @@ "main": "rive.js", |
@@ -48,3 +48,3 @@ interface RiveOptions { | ||
* `@rive-app/webgl` package | ||
* @returns A Rive CanvasRenderer class | ||
* @returns A Rive CanvasRenderer (Canvas2D) or Renderer (WebGL) class | ||
*/ | ||
@@ -54,3 +54,3 @@ makeRenderer( | ||
useOffscreenRenderer?: boolean | ||
): CanvasRenderer; | ||
): CanvasRenderer | Renderer; | ||
@@ -138,3 +138,4 @@ /** | ||
/** | ||
* Calls the context's clearRect() function to clear the entire canvas | ||
* Calls the context's clearRect() function to clear the entire canvas. Crucial to call | ||
* this at the start of the render loop to clear the canvas before drawing the next frame | ||
* | ||
@@ -208,2 +209,23 @@ * For the underlying API, check | ||
); | ||
/** | ||
* Canvas2D API for drawing an image onto a canvas | ||
*/ | ||
drawImage: ( | ||
image: | ||
| HTMLImageElement | ||
| SVGImageElement | ||
| HTMLVideoElement | ||
| HTMLCanvasElement | ||
| ImageBitmap | ||
| OffscreenCanvas, | ||
sx?: number, | ||
sy?: number, | ||
sWidth?: number, | ||
sHeight?: number, | ||
dx?: number, | ||
dy?: number, | ||
dWidth?: number, | ||
dHeight?: number | ||
) => void; | ||
} | ||
@@ -293,3 +315,3 @@ | ||
*/ | ||
draw(renderer: CanvasRenderer): void; | ||
draw(renderer: CanvasRenderer | Renderer): void; | ||
/** | ||
@@ -296,0 +318,0 @@ * Creates a LinearAnimation for the animation with the given name |
@@ -248,8 +248,3 @@ import * as rc from "./rive_advanced.mjs"; | ||
private _layout; | ||
private _updateLayout; | ||
private renderer; | ||
/** | ||
* Flag to active/deactivate renderer | ||
*/ | ||
private isRendererActive; | ||
private loaded; | ||
@@ -256,0 +251,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
510933
3285