Creates a new IconGizmo object.
The camera component.
The render layer.
Protected_The app.
Protected_The camera viewing the gizmo.
Protected_The coordinate space.
Protected_The graphics device.
Protected_The app event handles.
Protected_The render layer.
Protected_The mouse buttons that interact.
Protected_Whether a render update is due.
Protected_The gizmo scale.
The shapes the gizmo picks.
The graph nodes attached to the gizmo.
Whether to call preventDefault on pointer events.
The root gizmo entity.
Whether to draw light icons in the light color. Defaults to false.
Protected_Protected
Gets whether the gizmo shows only with attached nodes. A getter, so a subclass's value applies while the base constructor runs.
Gets the camera component to view the gizmo.
ProtectedcameraProtected
Gets the gizmo coordinate space.
Gets the gizmo enabled state.
Sets the gizmo enabled state.
ProtectedfacingProtected
Gets the icon size in CSS pixels.
Sets the icon size in CSS pixels. Defaults to 24.
Gets the gizmo render layer.
The mouse buttons that interact with the gizmo, by button index: 0 left, 1 middle, 2 right.
Gets the gizmo size.
Sets the gizmo size. Defaults to 1.
Gets the current theme for the gizmo.
Protected_Protected_Protected
Gets the scale keeping geometry at a world position a constant size on screen.
The world position.
The scale.
Protected_Protected
The icons face the camera in world space.
The icons keep their size on screen themselves.
Destroys the gizmo and its icons.
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.
Gets the entity whose icon a mesh instance draws, such as one a Picker returns, so an app can pick icons with the rest of its scene.
The mesh instance.
The entity, or null when the mesh instance draws no icon.
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. The handler is removed before it is called, so it runs at most once, even if it fires the same event again or throws.
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).
Places the icons of the attached entities.
Sets the theme or partial theme for the gizmo.
The partial theme to set.
StaticcreateCreates a new gizmo layer and adds it to the scene.
The app.
OptionallayerName: string = 'Gizmo'
The layer name. Defaults to 'Gizmo'.
OptionallayerIndex: number = app.scene.layers.layerList.length
The layer index. Defaults to the end of the layer list.
Optionaldepth: boolean = false
Whether the layer keeps the scene depth and sorts transparent mesh instances manually, as overlay gizmos need so occluded parts draw faint. Otherwise it clears depth and draws on top, as transform gizmos need. Defaults to false.
The new layer.
StaticEVENT_Fired when the icon of an entity is clicked.
StaticEVENT_Fired when graph nodes are attached.
StaticEVENT_Fired when graph nodes are detached.
StaticEVENT_Fired when the pointer is down on the gizmo.
StaticEVENT_Fired when the pointer is moving over the gizmo.
StaticEVENT_Fired when the pointer is up off the gizmo.
StaticEVENT_Fired when the gizmo's position is updated.
StaticEVENT_Fired when the gizmo render has updated.
StaticEVENT_Fired when the gizmo's rotation is updated.
StaticEVENT_Fired when the gizmo's scale is updated.
Draws an icon at each attached entity with nothing else to see, such as a light, camera or sound. Entities with an enabled render, model, sprite or element component show none, and a disabled component still shows its icon. Clicking an icon fires IconGizmo.EVENT_ICONSELECT. The icons are IconGizmo#iconSize CSS pixels square.
Use a layer that keeps the scene depth, so hidden icons use the
occludedcolor.Relevant Engine API examples: