Drag[en]gine Script Module DragonScript  1.21
Dragengine.InputDeviceButton Class Reference

Input device button. More...

Inheritance diagram for Dragengine.InputDeviceButton:

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...
 

Detailed Description

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.

Member Function Documentation

◆ getButtonIndex()

int Dragengine.InputDeviceButton.getButtonIndex ( )

Button index.

◆ getComponent()

String Dragengine.InputDeviceButton.getComponent ( )

Identifier of component or empty string if standalone.

Version
1.6

◆ getDisplayIconAt()

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.

◆ getDisplayIconCount()

int Dragengine.InputDeviceButton.getDisplayIconCount ( )

Count of icons representing the button in bindings.

◆ getDisplayImage()

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.

◆ getDisplayText()

String Dragengine.InputDeviceButton.getDisplayText ( )

Text to display centered across display image or icon.

◆ getID()

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.

◆ getInputDevice()

InputDevice Dragengine.InputDeviceButton.getInputDevice ( )

Owner input device.

◆ getLargestDisplayIconX()

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.

◆ getLargestDisplayIconY()

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.

◆ getName()

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.

◆ getTouchable()

bool Dragengine.InputDeviceButton.getTouchable ( )

Button can send touch/untouch events.

Version
1.11.1

◆ getType()

InputDeviceButtonType Dragengine.InputDeviceButton.getType ( )

Button type.

Version
1.6

◆ isPressed()

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.

◆ isTouched()

bool Dragengine.InputDeviceButton.isTouched ( )

Get touched state.

Version
1.6

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.


The documentation for this class was generated from the following file: