|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.gameengine.icadroids.input.OnScreenButtons
public class OnScreenButtons
This class provides statics and a few function to easily make use of the touch functionality of an android device. This class manages and draws virtual buttons to the screen to detect for input. When a button is enabled (by default) the user can check wether a button is pressed or not, by accessing the static boolean values for each correspodending button. Do not make an instance of this class yourself. If you want to use the OnScreenButtons in your game, set the static variable use to true.
Field Summary | |
---|---|
static boolean |
buttonA
holds the values of wether or not the button has been pressed. |
static boolean |
buttonB
holds the values of wether or not the button has been pressed. |
static boolean |
buttonX
holds the values of wether or not the button has been pressed. |
static boolean |
buttonY
holds the values of wether or not the button has been pressed. |
static boolean |
dPadDown
holds the values of wether or not the button has been pressed. |
static boolean |
dPadLeft
holds the values of wether or not the button has been pressed. |
static boolean |
dPadRight
holds the values of wether or not the button has been pressed. |
static boolean |
dPadUp
holds the values of wether or not the button has been pressed. |
static boolean |
feedback
feedback: wether or not to allow feedback |
static int |
opacity
opacity: sets the opacity of all the buttons in a range from 0 to 255 |
static boolean |
select
holds the values of wether or not the button has been pressed. |
static boolean |
start
holds the values of wether or not the button has been pressed. |
static boolean |
use
use : wether or not to actually use these buttons |
Constructor Summary | |
---|---|
OnScreenButtons(Activity gameEngine)
Do not call the constructor yourself this is for the GameEngine. |
Method Summary | |
---|---|
protected static void |
buttonPressed(int buttonId)
Method that will be called by the OnScreenButton to notify the onscreenbuttons an button has been pressed |
protected static void |
buttonReleased(int buttonId)
Method that will be called by the OnScreenButton to notify the onscreenbuttons an button has been pressed |
static void |
disableButton(int buttonId)
Disable a onscreenbutton |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean use
public static boolean feedback
public static int opacity
public static boolean dPadUp
public static boolean dPadDown
public static boolean dPadLeft
public static boolean dPadRight
public static boolean buttonA
public static boolean buttonB
public static boolean buttonX
public static boolean buttonY
public static boolean start
public static boolean select
Constructor Detail |
---|
public OnScreenButtons(Activity gameEngine)
gameEngine
- : The context is required by this class so it can receive the
screen width and height.Method Detail |
---|
protected static void buttonPressed(int buttonId)
buttonId
- The layout id of the buttonprotected static void buttonReleased(int buttonId)
buttonId
- public static void disableButton(int buttonId)
buttonId
- The id of the button that needs to be dissabled. you can get
the button id by using R.id.(button name).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |