@rive-app/canvas-advanced
Advanced tools
Comparing version 1.1.10 to 1.2.0
{ | ||
"name": "@rive-app/canvas-advanced", | ||
"version": "1.1.10", | ||
"version": "1.2.0", | ||
"description": "Rive's lightweight low-level canvas based web api.", | ||
@@ -5,0 +5,0 @@ "main": "canvas_advanced.mjs", |
@@ -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 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
255571
885