-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
### VfxDisplay | ||
|
||
the vfx-display represents an offscreen canvas. however, a canvas _context_ is not created. | ||
|
||
these contexts are provided: | ||
|
||
| context name | type | description | | ||
|------|------|-------------| | ||
| `canvas` | [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) | the offscreen canvas connected to the canvas element in the main document | | ||
| `canvasSize` | [**width**: _number_, **height**: _number_, **pixelRatio**: _number_] | the size of the canvas element in _device pixels_. i.e. the pixelRatio is already included in the width and height specification. if you want the _css pixels_, divide the width and height by the pxelRatio | | ||
|
||
In addition, the `onRenderFrame` event is dispatched to the entity and its children. | ||
|
||
The `onRenderFrame` event comes with a data object: | ||
|
||
| property | type | description | | ||
|----------|------|-------------| | ||
| `canvas` | [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) | the offscreen canvas object, which is also offered as context | | ||
| `now` | _number_ | the current time in seconds. see [performance.now](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) | | ||
| `frameNo` | _number_ | a frame counter. starts at 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters