Skip to content

Commit 452e0d6

Browse files
authored
Add event functions for loading in needle engine
1 parent 10713cf commit 452e0d6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

documentation/reference/needle-engine-attributes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ The table below shows a list of available attributes and their descriptions.
2020
| `loading-background` | **PRO** — Default: `transparent`. Change the loading background color (e.g. `#dd5500`) |
2121
| `loading-logo-src` | **PRO** — Change the loading logo image (e.g. `https://yourdomain.com/logo.png` or `/logo.png`) |
2222
| `hide-loading-overlay` | **PRO** — Do not show the loading overlay
23+
| **Events** | |
24+
| `loadstart` | Name of the function to call when loading starts. Note that the arguments are `(ctx:Context, evt:Event)`. You can call `evt.preventDefault()` to hide the default loading overlay |
25+
| `progress` | Name of the function to call when loading updates. `onProgress(ctx:Context, evt: {detail: {context:Context, name:string, index:number, count:number, totalProgress01:number, progress:ProgressEvent}) { ... }` |
26+
| `loadfinished` | Name of the function to call when loading finishes |
2327
| **Rendering** | |
2428
| `background-color` | optional, hex color to be used as a background color. Examples: `rgb(255, 200, 100)`, `#dddd00` |
2529
| `background-image` | optional, URL to a skybox image (background image) or a preset string: `studio`, `blurred-skybox`, `quicklook`, `quicklook-ar` |
@@ -32,10 +36,6 @@ The table below shows a list of available attributes and their descriptions.
3236
| `autoplay` | add or set to `true` to auto play animations e.g. `<needle-engine autoplay` |
3337
| `camera-controls` | add or set to `true` to automatically add OrbitControls if no camera controls are found in the scene |
3438
| `auto-rotate` | add to enable auto-rotate (only used with `camera-controls`) |
35-
| **Events** | |
36-
| `loadstart` | Name of the function to call when loading starts. Note that the arguments are `(ctx:Context, evt:Event)`. You can call `evt.preventDefault()` to hide the default loading overlay |
37-
| `progress` | Name of the function to call when loading updates. `onProgress(ctx:Context, evt: {detail: {context:Context, name:string, index:number, count:number, totalProgress01:number, progress:ProgressEvent}) { ... }` |
38-
| `loadfinished` | Name of the function to call when loading finishes |
3939
| **Advanced** | *Available options to change how the Needle Engine loading display looks. Use `?debugloadingrendering` for easier editing* |
4040
| `dracoDecoderPath` | URL to the draco decoder e.g. `./include/draco/` to use the local Draco decoder |
4141
| `dracoDecoderType` | draco decoder type. Options are `wasm` or `js`. See [three.js documentation](https://threejs.org/docs/#examples/en/loaders/DRACOLoader.setDecoderConfig) |

0 commit comments

Comments
 (0)