Creates the inspector and shows its panel. The panel is appended to the document body and follows the app until destroy is called, or the app is destroyed.
The app to inspect.
Optionaloptions: InspectorOptions = {}
The options.
The app being inspected.
Seconds between refreshes of the active list while the app runs. Structure changes show up within this interval. Refreshes are cheap, but not free on very large scenes.
Outline the selected node in the viewport: the bounds of its mesh instances, the frustum of its camera, the shape of its light, or its axes when it has none of those. On the Physics tab, the collision shape or joint of the selected entity.
The color of the viewport outline.
A node whose enabled checkbox, and those of its ancestors, are withheld from the hierarchy.
The key that pauses and resumes the app. Empty disables the key.
Seconds between property refreshes of the selected item while the app runs.
The key that advances one frame while paused. Empty disables the key.
The KeyboardEvent.code or key that shows and hides the panel. Empty disables the key.
The side of the viewport the panel docks to.
Whether the app is paused. Pausing sets AppBase#timeScale to zero and suspends the sound manager; resuming restores the time scale that was in effect.
Whether the physics world is drawn over the scene while the panel is shown. The same as the Draw checkbox of the Physics tab. Hiding the panel suspends the drawing; showing it again resumes it.
The node selected in the hierarchy, or null.
A gap left above the docked panel in CSS pixels, to keep it clear of other overlays.
The width of the docked panel in CSS pixels. Also adjustable by dragging its inner edge.
Removes the panel, releases every hook into the app and restores anything the inspector changed: the time scale while paused, the GPU profiler, the physics debug drawer.
Brings a popped-out panel back into the page and closes its window.
Fire an event, all additional arguments are passed on to the event listener.
Name of event to fire.
Optionalarg1: any
First argument that is passed to the event handler.
Optionalarg2: any
Second argument that is passed to the event handler.
Optionalarg3: any
Third argument that is passed to the event handler.
Optionalarg4: any
Fourth argument that is passed to the event handler.
Optionalarg5: any
Fifth argument that is passed to the event handler.
Optionalarg6: any
Sixth argument that is passed to the event handler.
Optionalarg7: any
Seventh argument that is passed to the event handler.
Optionalarg8: any
Eighth argument that is passed to the event handler.
Self for chaining.
Test if there are any handlers bound to an event name.
The name of the event to test.
True if the object has handlers bound to the specified event name.
Detach an event handler from an event. If callback is not provided then all callbacks are unbound from the event, if scope is not provided then all events with the callback will be unbound.
Use this form to remove all listeners matching a name (and optionally callback/scope). To remove a single known subscription, prefer retaining the EventHandle returned by EventHandler#on / EventHandler#once and calling its EventHandle#off: it removes exactly that subscription and is faster (no scan of the callback list).
Optionalname: string
Name of the event to unbind.
Optionalcallback: HandleEventCallback
Function to be unbound.
Optionalscope: any
Scope that was used as the this when the event is fired.
Self for chaining.
const handler = () => {};
obj.on('test', handler);
obj.off(); // Removes all events
obj.off('test'); // Removes all events called 'test'
obj.off('test', handler); // Removes all handler functions, called 'test'
obj.off('test', handler, this); // Removes all handler functions, called 'test' with scope this
Attach an event handler to an event.
Name of the event to bind the callback to.
Function that is called when event is fired. Note the callback is limited to 8 arguments.
Optionalscope: any = ...
Object to use as 'this' when the event is fired, defaults to current this.
An event handle. For later removal, prefer retaining this handle and calling its EventHandle#off over EventHandler#off with a name/callback: it removes exactly this subscription and is faster (no scan of the callback list).
Attach an event handler to an event. This handler will be removed after being fired once.
Name of the event to bind the callback to.
Function that is called when event is fired. Note the callback is limited to 8 arguments.
Optionalscope: any = ...
Object to use as 'this' when the event is fired, defaults to current this.
An event handle. For removal before it fires, prefer retaining this handle and calling its EventHandle#off over EventHandler#off with a name/callback: it removes exactly this subscription and is faster (no scan of the callback list).
Moves the panel into its own browser window, leaving the canvas unobscured. Must be called from a user gesture, or the browser blocks the window.
Refreshes the active list and the property view immediately.
Selects a node, revealing it in the hierarchy and showing its properties.
The node, or null to clear the selection.
Advances the app by one frame. Only meaningful while paused.
Static_A KeyboardEvent.code or key.
The key in brackets for a button label, or an empty string when unset.
Static_A KeyboardEvent.code or key.
The key as shown on a button, or an empty string when unset.
StaticEVENT_Fired when the panel is shown or hidden, whether through visible, the toggle key or the panel's own close button. The handler is passed the new visibility.
An in-page inspector for a running application. It docks a panel over the canvas with four tabs above a live property view of whatever is selected:
The app can be paused and stepped a frame at a time, and the panel can be popped out into its own window to leave the canvas unobscured.
The view is read-only, with one exception: the checkbox on each hierarchy row flips the node's enabled flag.
Default keys: backquote toggles the panel, F9 pauses and resumes, F10 steps one frame while paused. Pausing sets AppBase#timeScale to zero and suspends the sound manager, so rendering continues while every time-driven system stands still. Scripts that read the wall clock rather than the frame delta keep moving.
The property view is generic: it reflects on the public getters of each component and script, so components it has never heard of show up with all of their state.