java.lang.Object
technology.sola.engine.input.SolaControls
SolaControls contains control definitions for a
Sola
to use. Each control that is
added can have multiple ControlInput
s. If any ControlInput
is in an active state then the control
will be considered active.-
Constructor Summary
ConstructorsConstructorDescriptionSolaControls
(KeyboardInput keyboardInput, MouseInput mouseInput) Creates a SolaControls instance wrapping all supported input devices. -
Method Summary
Modifier and TypeMethodDescriptionaddControl
(String id, List<ControlInput> controlInputs) Adds a control with specifiedControlInput
s.addControl
(String id, ControlInput controlInput) Adds a control with only a single specifiedControlInput
.addControls
(ControlsConfig controlsConfig) Adds all controls from aControlsConfig
.boolean
Checks to see if specified control is currently active.setControls
(ControlsConfig controlsConfig) Clears any existing controls and adds all controls from aControlsConfig
.
-
Constructor Details
-
SolaControls
Creates a SolaControls instance wrapping all supported input devices.- Parameters:
keyboardInput
- theKeyboardInput
mouseInput
- theMouseInput
-
-
Method Details
-
isActive
Checks to see if specified control is currently active.- Parameters:
controlId
- the control to check- Returns:
- true if the control is active
-
addControl
Adds a control with only a single specifiedControlInput
.- Parameters:
id
- the control idcontrolInput
- theControlInput
for the control- Returns:
- this
-
addControl
Adds a control with specifiedControlInput
s.- Parameters:
id
- the control idcontrolInputs
- theControlInput
s for the control- Returns:
- this
-
addControls
Adds all controls from aControlsConfig
.- Parameters:
controlsConfig
- theControlsConfig
- Returns:
- this
-
setControls
Clears any existing controls and adds all controls from aControlsConfig
.- Parameters:
controlsConfig
- theControlsConfig
- Returns:
- this
-