new SceneModePicker
The SceneModePicker is a single button widget for switching between scene modes; shown to the left in its expanded state. Programatic switching of scene modes will be automatically reflected in the widget as long as the specified SceneTransitioner is used to perform the change.
Parameters:
Name | Type | Description |
---|---|---|
container |
Element | String | The DOM element or ID that will contain the widget. |
transitioner |
SceneTransitioner | The SceneTransitioner instance to use. |
Throws:
-
DeveloperError : container is required.
-
DeveloperError : Element with id "container" does not exist in the document.
-
DeveloperError : transitioner is required.
Example
// In HTML head, include a link to the SceneModePicker.css stylesheet, // and in the body, include: <div id="sceneModePickerContainer"></div> // Note: This code assumed you already have a Scene instance. var transitioner = new SceneTransitioner(scene); var sceneModePicker = new SceneModePicker('sceneModePickerContainer', transitioner);
Members
-
container :Element
-
Gets the parent container.
-
viewModel :SceneModePickerViewModel
-
Gets the view model.
Methods
-
destroy
-
Destroys the widget. Should be called if permanently removing the widget from layout.
-
isDestroyed
-
Returns:
Boolean true if the object has been destroyed, false otherwise.