Drag[en]gine Script Module DragonScript
1.23
|
Input device button. More...
Public Member Functions | |
Management | |
InputDevice | getInputDevice () |
Owner input device. More... | |
int | getButtonIndex () |
Button index. More... | |
Buttons | |
String | getID () |
Button identifier. More... | |
String | getName () |
Display name. More... | |
InputDeviceButtonType | getType () |
Button type. More... | |
String | getComponent () |
Identifier of component or empty string if standalone. More... | |
Image | getDisplayImage () |
Image to represent the button in 2D user interfaces or NULL if not set. More... | |
int | getDisplayIconCount () |
Count of icons representing the button in bindings. More... | |
Image | getDisplayIconAt (int index) |
Icon at index representing the button in bindings. More... | |
Image | getLargestDisplayIconX (int maxWidth) |
Largest icon not exceeding width representing the device in bindings. More... | |
Image | getLargestDisplayIconY (int maxHeight) |
Largest icon not exceeding height representing the device in bindings. More... | |
String | getDisplayText () |
Text to display centered across display image or icon. More... | |
bool | getTouchable () |
Button can send touch/untouch events. More... | |
bool | isPressed () |
Get pressed state. More... | |
bool | isTouched () |
Get touched state. More... | |
Input device button.
Wraps a input device button by button index.
Buttons can be anything a user can press. This can be a mouse button, buttons on keypads, keys on keyboards or touch fields on screens. Buttons have a pressed or not pressed state. Pressure sensitive input elements are handled as axes not buttons.
This is a native class.
int Dragengine.InputDeviceButton.getButtonIndex | ( | ) |
Button index.
String Dragengine.InputDeviceButton.getComponent | ( | ) |
Identifier of component or empty string if standalone.
Image Dragengine.InputDeviceButton.getDisplayIconAt | ( | int | index | ) |
Icon at index representing the button in bindings.
Icon is of square size and typically has a size of 16, 24, 32 or 64.
int Dragengine.InputDeviceButton.getDisplayIconCount | ( | ) |
Count of icons representing the button in bindings.
Image Dragengine.InputDeviceButton.getDisplayImage | ( | ) |
Image to represent the button in 2D user interfaces or NULL if not set.
Large image of 128 pixels squared or larger.
String Dragengine.InputDeviceButton.getDisplayText | ( | ) |
Text to display centered across display image or icon.
String Dragengine.InputDeviceButton.getID | ( | ) |
Button identifier.
Unique identifier for the button identifying it inside the parent device. The prefix is a normalized string that contains only letters, numbers and underscores. It is suitable to be combined with the device identifier to store them in config files as key bindings.
InputDevice Dragengine.InputDeviceButton.getInputDevice | ( | ) |
Owner input device.
Image Dragengine.InputDeviceButton.getLargestDisplayIconX | ( | int | maxWidth | ) |
Largest icon not exceeding width representing the device in bindings.
Icon typically has a size of 16, 24, 32 or 64.
Image Dragengine.InputDeviceButton.getLargestDisplayIconY | ( | int | maxHeight | ) |
Largest icon not exceeding height representing the device in bindings.
Icon typically has a size of 16, 24, 32 or 64.
String Dragengine.InputDeviceButton.getName | ( | ) |
Display name.
Dispaly name is human readable like for example 'Button #1'. The name is unique but not guaranteed to stay the same across restarting the input module or game engine.
bool Dragengine.InputDeviceButton.getTouchable | ( | ) |
Button can send touch/untouch events.
InputDeviceButtonType Dragengine.InputDeviceButton.getType | ( | ) |
Button type.
bool Dragengine.InputDeviceButton.isPressed | ( | ) |
Get pressed state.
This obtains the current pressed state from the input module. If the device has been detached from the host platform in the mean time false is returned. In contrary to InputSystem.getButtonPressed() no exception is thrown. This allows to keep a reference to this instance without worrying about the device being detached from the system. If reattached the device properly works again.
bool Dragengine.InputDeviceButton.isTouched | ( | ) |
Get touched state.
This obtains the current touched state from the input module. If the device has been detached from the host platform in the mean time false is returned. In contrary to InputSystem.getButtonTouched() no exception is thrown. This allows to keep a reference to this instance without worrying about the device being detached from the system. If reattached the device properly works again.