new ComboBoxMarker()
SKARF.GuiMarker that emulates a combo box. Selection is based on orientation of marker.
Please do not instantiate this class on your own. Use the
Please do not instantiate this class on your own. Use the
GuiMarkerFactory
instead.
GUI markers work via event callbacks. Users should define callback functions in their JavaScript which matches this format: myKey_myCallbackType. For example, if you have a GUI marker with key of "sculptAmountSlider" (defined in JSON file) and you want it to react to the "changed" event, create a function named "sculptAmountSlider_changed" i.e.
sculptAmountSlider_changed = function (params) { ... }The params argument will contain necessary data for that particular event. In the example above, params.delta will give the change in rotation since previous frame.
Available events:
- changed
- params.guiMarker: this instance
- params.selectedId: 0-based numeric ID of selection
- params.rotation: current world rotation
Available parameter in JSON file:
- numChoices: total number of choices for the combo box (compulsory)
Inherited events from SKARF.GuiMarker:
- moved: invoked when marker is moved
- params.guiMarker: this instance
- params.position: current world position
- params.dPosition: change in position since previous frame
- rotated: invoked when marker is rotated
- params.guiMarker: this instance
- params.rotation: current world rotation
- params.dRotation: change in rotation since previous frame
- detected: invoked when the detected() method is called
- params.guiMarker: this instance
- params.worldMatrix: world matrix of the marker solve
- params.position: current world position
- params.rotation: current world rotation
- firstDetected: invoked when the detected() method is first called since last hidden() call
- params.guiMarker: this instance
- params.worldMatrix: world matrix of the marker solve
- params.position: current world position
- params.rotation: current world rotation
- hidden: invoked when the hidden() method is called
- params.guiMarker: this instance
- firstHidden: invoked when the hidden() method is first called since last detected() call
- params.guiMarker: this instance
Extends
Methods
-
detected(dt, worldMatrix)
-
Call this method when the GUI marker is detected
Parameters:
Name Type Description dt
number Time elapsed since previous frame worldMatrix
THREE.Matrix4 World matrix for the marker - Inherited From:
- Source:
-
hidden()
-
Call this method when the marker has been hidden
- Inherited From:
- Source: