ControlsGUI Class
Item Index
Methods
createDiv
-
guiContainer -
classes -
callback
Creates a DIV and appends to the given DOMElement container.
Parameters:
-
guiContainerDOMElementThe container to append the DIV to.
-
classesStringThe classname to give the DIV.
-
callbackFunctionOptional callback function.
Returns:
The newly created DIV.
createGUI
-
planetShortcuts -
triggerAnimationParameter
Creates the GUI.
Parameters:
-
planetShortcutsObjectArray of planet names and the keyboard shortcut to use to snap to them.
-
triggerAnimationParameterFunctionProvides a hook for updating animation after changing input values (@TODO - this is a code smell. Should decouple the animation from the GUI inputs.)
createInstructions
-
instructionsContainer -
planetShortcuts
Parameters:
-
instructionsContainerDOMElementThe DIV we need to populate with instructions.
-
planetShortcutsObjectArray of planet names and the keyboard shortcut to use to snap to them.
createSlider
-
config
Creates a slider.
Parameters:
-
configObjectConfiguration object.
createSliders
-
guiContainer
Creates the sliders in the GUI.
Parameters:
-
guiContainerDOMElementDocument element to insert the sliders in.
init
()
Initialises the GUI.
updateMillisecondsPerDay
()
Updates the value displayed to users when they change the number of milliseconds per day.
updateValueOfSliders
-
globalSlider -
slidersToUpdate
Updates the value of all the given sliders. This way we can have one 'master' slider that controls all the others.
Parameters:
-
globalSliderStringID of the master slider.
-
slidersToUpdateArrayArray of IDs of the sliders that should be updated when the master is updated.
