ControlsGUI Class
Item Index
Methods
createDiv
-
guiContainer
-
classes
-
callback
Creates a DIV and appends to the given DOMElement container.
Parameters:
-
guiContainer
DOMElementThe container to append the DIV to.
-
classes
StringThe classname to give the DIV.
-
callback
FunctionOptional callback function.
Returns:
The newly created DIV.
createGUI
-
planetShortcuts
-
triggerAnimationParameter
Creates the GUI.
Parameters:
-
planetShortcuts
ObjectArray of planet names and the keyboard shortcut to use to snap to them.
-
triggerAnimationParameter
FunctionProvides 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:
-
instructionsContainer
DOMElementThe DIV we need to populate with instructions.
-
planetShortcuts
ObjectArray of planet names and the keyboard shortcut to use to snap to them.
createSlider
-
config
Creates a slider.
Parameters:
-
config
ObjectConfiguration object.
createSliders
-
guiContainer
Creates the sliders in the GUI.
Parameters:
-
guiContainer
DOMElementDocument 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:
-
globalSlider
StringID of the master slider.
-
slidersToUpdate
ArrayArray of IDs of the sliders that should be updated when the master is updated.