|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.BasicGame org.newdawn.slick.tests.InputTest
public class InputTest
A test for input
Field Summary |
---|
Fields inherited from class org.newdawn.slick.BasicGame |
---|
controllerButton, controllerDown, controllerLeft, controllerRight, controllerUp |
Constructor Summary | |
---|---|
InputTest()
Create a new input test |
Method Summary | |
---|---|
void |
controllerButtonPressed(int controller,
int button)
Notification that a button control has been pressed on the controller. |
void |
init(GameContainer container)
Initialise the game. |
void |
keyPressed(int key,
char c)
Notification that a key was pressed |
void |
keyReleased(int key,
char c)
Notification that a key was released |
static void |
main(java.lang.String[] argv)
Entry point to our test |
void |
mouseClicked(int button,
int x,
int y,
int clickCount)
Notification that a mouse button was clicked. |
void |
mouseMoved(int oldx,
int oldy,
int newx,
int newy)
Notification that mouse cursor was moved |
void |
mousePressed(int button,
int x,
int y)
Notification that a mouse button was pressed |
void |
mouseReleased(int button,
int x,
int y)
Notification that a mouse button was released |
void |
mouseWheelMoved(int change)
Notification that the mouse wheel position was updated |
void |
render(GameContainer container,
Graphics g)
Render the game's screen here. |
void |
update(GameContainer container,
int delta)
Update the game logic here. |
Methods inherited from class org.newdawn.slick.BasicGame |
---|
closeRequested, controllerButtonReleased, controllerDownPressed, controllerDownReleased, controllerLeftPressed, controllerLeftReleased, controllerRightPressed, controllerRightReleased, controllerUpPressed, controllerUpReleased, getTitle, inputEnded, inputStarted, isAcceptingInput, mouseDragged, setInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputTest()
Method Detail |
---|
public void init(GameContainer container) throws SlickException
Game
init
in interface Game
init
in class BasicGame
container
- The container holding the game
SlickException
- Throw to indicate an internal errorBasicGame.init(org.newdawn.slick.GameContainer)
public void render(GameContainer container, Graphics g)
Game
container
- The container holing this gameg
- The graphics context that can be used to render. However, normal rendering
routines can also be used.Game.render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
public void update(GameContainer container, int delta)
Game
update
in interface Game
update
in class BasicGame
container
- The container holing this gamedelta
- The amount of time thats passed since last update in millisecondsBasicGame.update(org.newdawn.slick.GameContainer, int)
public void keyPressed(int key, char c)
KeyListener
keyPressed
in interface KeyListener
keyPressed
in class BasicGame
key
- The key code that was pressed (@see org.newdawn.slick.Input)c
- The character of the key that was pressedBasicGame.keyPressed(int, char)
public void keyReleased(int key, char c)
KeyListener
keyReleased
in interface KeyListener
keyReleased
in class BasicGame
key
- The key code that was released (@see org.newdawn.slick.Input)c
- The character of the key that was releasedBasicGame.keyReleased(int, char)
public void mousePressed(int button, int x, int y)
MouseListener
mousePressed
in interface MouseListener
mousePressed
in class BasicGame
button
- The index of the button (starting at 0)x
- The x position of the mouse when the button was pressedy
- The y position of the mouse when the button was pressedBasicGame.mousePressed(int, int, int)
public void mouseReleased(int button, int x, int y)
MouseListener
mouseReleased
in interface MouseListener
mouseReleased
in class BasicGame
button
- The index of the button (starting at 0)x
- The x position of the mouse when the button was releasedy
- The y position of the mouse when the button was releasedBasicGame.mouseReleased(int, int, int)
public void mouseClicked(int button, int x, int y, int clickCount)
MouseListener
mouseClicked
in interface MouseListener
mouseClicked
in class BasicGame
button
- The index of the button (starting at 0)x
- The x position of the mouse when the button was pressedy
- The y position of the mouse when the button was pressedclickCount
- The number of times the button was clickedBasicGame.mouseClicked(int, int, int, int)
public void mouseWheelMoved(int change)
MouseListener
mouseWheelMoved
in interface MouseListener
mouseWheelMoved
in class BasicGame
change
- The amount of the wheel has movedBasicGame.mouseWheelMoved(int)
public void mouseMoved(int oldx, int oldy, int newx, int newy)
MouseListener
mouseMoved
in interface MouseListener
mouseMoved
in class BasicGame
oldx
- The old x position of the mouseoldy
- The old y position of the mousenewx
- The new x position of the mousenewy
- The new y position of the mouseBasicGame.mouseMoved(int, int, int, int)
public void controllerButtonPressed(int controller, int button)
ControllerListener
controllerButtonPressed
in interface ControllerListener
controllerButtonPressed
in class BasicGame
controller
- The index of the controller on which the control
was pressed.button
- The index of the button pressed (starting at 1)BasicGame.controllerButtonPressed(int, int)
public static void main(java.lang.String[] argv)
argv
- The arguments passed into our test
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |