Methods
inverse_lerp(a, b, value) → {number}
Returns the progress value between two numbers given an interpolated value.
Name | Type | Description |
---|---|---|
a | number | The start value. |
b | number | The end value. |
value | number | The value to find the progress of. |
- Source
The progress value.
- Type:
- number
lerp(a, b, t) → {number}
Linearly interpolates between two values given a progress value.
Name | Type | Description |
---|---|---|
a | number | The start value. |
b | number | The end value. |
t | number | The progress value. |
- Source
The interpolated value.
- Type:
- number
matrix_product(a, b, a_rows, a_columns, b_columns) → {Array.<number>}
Multiplies two matrices together.
Name | Type | Description |
---|---|---|
a | Array.<number> | The first matrix to multiply as a flat array. |
b | Array.<number> | The second matrix to multiply as a flat array. |
a_rows | number | The number of rows in the first matrix. |
a_columns | number | The number of columns in the first matrix. |
b_columns | number | The number of columns in the second matrix. |
- Source
The product of the two matrices.
- Type:
- Array.<number>
matrix_product_path(matrix, path, a_rows, a_columns, b_columns) → {Path2D}
Multiplies a matrix by a path of 2D points, returning a new path.
Name | Type | Description |
---|---|---|
matrix | Array.<number> | The matrix to multiply as a flat array. |
path | Path2D | The path to multiply. |
a_rows | number | The number of rows in the first matrix. |
a_columns | number | The number of columns in the first matrix. |
b_columns | number | The number of columns in the second matrix. |
- Source
The product of the matrix and the path.
- Type:
- Path2D
(async) play(animations, duration, easing) → {Promise.<void>}
Plays an animation.
Name | Type | Description |
---|---|---|
animations | Map.<(string|number), Animation> | The animations to play. |
duration | number | The duration of the animation in milliseconds. |
easing | Easing | The easing function to use. |
- Source
- A promise that resolves when the animation has finished.
- Type:
- Promise.<void>
(async) render() → {Promise.<void>}
Renders the scene to the canvas. Preferably don't await to keep the animation smooth.
- A promise that resolves when the scene has been rendered.
- Type:
- Promise.<void>
(async) render() → {Promise.<void>}
Renders the scene to the SVG. Preferably don't await to keep the animation smooth.
- A promise that resolves when the scene has been rendered.
- Type:
- Promise.<void>
resume() → {void}
Resumes the scene.
- Source
- Type:
- void
stop() → {void}
Stops the scene.
- Source
- Type:
- void