|
Game Control Plus
1.2.2
|

Public Member Functions | |
| void | plug (final Object i_object, final String i_methodName, final int i_eventType) |
| void | plug (final String i_methodName, final int i_eventType) |
| String | toText (String tab) |
Public Member Functions inherited from org.gamecontrolplus.ControlInput | |
| String | getName () |
| float | getValue () |
| float | getTolerance () |
| void | setTolerance (final float i_tolerance) |
| float | getMultiplier () |
| void | setMultiplier (final float i_multiplier) |
Protected Member Functions | |
| void | callPlugs (final List< Plug > i_plugList) |
Protected Attributes | |
| final List< Plug > | onPressPlugs = new ArrayList<Plug>() |
| final List< Plug > | onReleasePlugs = new ArrayList<Plug>() |
| final List< Plug > | whilePressPlugs = new ArrayList<Plug>() |
Protected Attributes inherited from org.gamecontrolplus.ControlInput | |
| float | actualValue = 0f |
| float | tolerance = 0f |
| float | multiplier = 1f |
| final String | actualName |
| int | inputType |
Package Functions | |
| ControlButton (final Component i_component, final PApplet i_parent) | |
| void | update () |
Package Functions inherited from org.gamecontrolplus.ControlInput | |
| ControlInput (final Component i_component) | |
Private Attributes | |
| boolean | pressed = false |
| boolean | oldPressed = false |
| final PApplet | parent |
Related Functions | |
(Note that these are not member functions.) | |
| boolean | pressed () |
Additional Inherited Members | |
Public Attributes inherited from org.gamecontrolplus.gui.KConstants | |
| final float | INPUT_UI_HEIGHT = 24 |
| final float | DESC_UI_HEIGHT = 30 |
| final float | ELEMENT_UI_GAP = 4 |
| final float | INPUT_UI_LENGTH = 220 |
| final float | DESC_UI_LENGTH = 300 |
| final float | TEXTFIELD_GAP = 4 |
| final float | INICATOR_D = 12 |
| final float | CONNECTOR_SIZE_R = 10 |
| final float | CONNECTOR_SIZE_R2 = CONNECTOR_SIZE_R * CONNECTOR_SIZE_R |
| final float | CONNECTOR_SIZE_D = 2 * CONNECTOR_SIZE_R |
| final int | INPUT = 0x01 |
| final int | DESC = 0x02 |
| final float | FONT_SIZE = 12 |
| final int | PANEL_WIDTH = 320 |
| final int | PANEL_HEIGHT = 280 |
| final int | UI_BUTTON = 0x01 |
| final int | UI_COOLIEHAT = 0x02 |
| final int | UI_SLIDER = 0x03 |
| final int | UI_DESCRIPTOR = 0x04 |
| final int[] | UI_E_BACK = new int[] { 0, 0xFFFFD0D0, 0xFFD0FFD0, 0xFFD0D0FF, 0xFFFFD0D0 } |
| final int | BACKGROUND = 0xFFF0FFF0 |
| final int | PANEL = 0xFF208020 |
| final int | BORDER = 0xFF4040A0 |
| final int | CONNECTION = 0xFF8080A0 |
| final int | HIGHLIGHT = 0xFFFF40FF |
| final int | NAME_AREA = 0xFFC8C8FF |
| final int | CONNECTOR = 0xFFFFC0FF |
| final int | TEXTFILL = 0xFF000080 |
| final int | PRESSED = 0xFFFF3030 |
| final int | RELEASED = 0xFF802020 |
| final int | SLIDER_CURSOR = 0xFFFF4040 |
| int | WORKING = 0 |
| int | CANCELLED = 1 |
| int | FINISHED = 2 |
| int | NOT_OVER = 0x0000 |
| int | OVER_CONNECTOR = 0x0100 |
| int | ON_PRESS = 0 |
| int | ON_RELEASE = 1 |
| int | WHILE_PRESS = 2 |
| int | BUTTON_TYPE = 1 |
| int | HAT_TYPE = 2 |
| int | SLIDER_TYPE = 3 |
| String | SEPARATOR = "\t" |
Package Attributes inherited from org.gamecontrolplus.ControlInput | |
| final Component | component |
This class represents a button of a device. You can use the pressed() method to see if a button is pressed or use the plug method to handle events.
|
package |
Initializes a new Button.
| i_component |
|
protected |
Call all plugs for this button
| i_plugList |
| void org.gamecontrolplus.ControlButton.plug | ( | final Object | i_object, |
| final String | i_methodName, | ||
| final int | i_eventType | ||
| ) |
Plug is a handy method to handle incoming button events. To create a plug you have to implement a method that reacts on the events. To plug a method you need to give a button the method name and the event type you want to react on. If your method is inside a class you have to give the plug a reference to it.
| i_object | Object: the object with the method to plug |
| i_methodName | String: the name of the method that has to be plugged |
| i_eventType | constant: can be ControllIO.ON_PRESS, ControllIO.ON_RELEASE or ControllIO.WHILE_PRESS |
| void org.gamecontrolplus.ControlButton.plug | ( | final String | i_methodName, |
| final int | i_eventType | ||
| ) |
Plug is a handy method to handle incoming button events. To create a plug you have to implement a method that reacts on the events. To plug a method you need to give a button the method name and the event type you want to react on. If your method is inside a class you have to give the plug a reference to it.
| i_methodName | String: the name of the method that has to be plugged |
| i_eventType | constant: can be ControllIO.ON_PRESS, ControllIO.ON_RELEASE or ControllIO.WHILE_PRESS |
| String org.gamecontrolplus.ControlButton.toText | ( | String | tab | ) |
Get a text description for this button
| tab |
|
packagevirtual |
This method is called before each frame to update the button state.
Implements org.gamecontrolplus.ControlInput.
Reimplemented in org.gamecontrolplus.ControlHat.
|
related |
This method returns true if the button was pressed.
|
private |
Instance to the PApplet where ProControl Plus is running