|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.state.BasicGameState
public abstract class BasicGameState
A simple state used an adapter so we don't have to implement all the event methods every time.
Constructor Summary | |
---|---|
BasicGameState()
|
Method Summary | |
---|---|
void |
controllerButtonPressed(int controller,
int button)
Notification that a button control has been pressed on the controller. |
void |
controllerButtonReleased(int controller,
int button)
Notification that a button control has been released on the controller. |
void |
controllerDownPressed(int controller)
Notification that the down control has been pressed on the controller. |
void |
controllerDownReleased(int controller)
Notification that the down control has been released on the controller. |
void |
controllerLeftPressed(int controller)
Notification that the left control has been pressed on the controller. |
void |
controllerLeftReleased(int controller)
Notification that the left control has been released on the controller. |
void |
controllerRightPressed(int controller)
Notification that the right control has been pressed on the controller. |
void |
controllerRightReleased(int controller)
Notification that the right control has been released on the controller. |
void |
controllerUpPressed(int controller)
Notification that the up control has been pressed on the controller. |
void |
controllerUpReleased(int controller)
Notification that the up control has been released on the controller. |
void |
enter(GameContainer container,
StateBasedGame game)
Notification that we've entered this game state |
abstract int |
getID()
Get the ID of this state |
void |
inputEnded()
Notification that all input events have been sent for this frame |
void |
inputStarted()
Notification that input is about to be processed |
boolean |
isAcceptingInput()
Check if this input listener is accepting input |
void |
keyPressed(int key,
char c)
Notification that a key was pressed |
void |
keyReleased(int key,
char c)
Notification that a key was released |
void |
leave(GameContainer container,
StateBasedGame game)
Notification that we're leaving this game state |
void |
mouseClicked(int button,
int x,
int y,
int clickCount)
Notification that a mouse button was clicked. |
void |
mouseDragged(int oldx,
int oldy,
int newx,
int newy)
Notification that mouse cursor was dragged |
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 newValue)
Notification that the mouse wheel position was updated |
void |
setInput(Input input)
Set the input that events are being sent from |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.newdawn.slick.state.GameState |
---|
init, render, update |
Constructor Detail |
---|
public BasicGameState()
Method Detail |
---|
public void inputStarted()
ControlledInputReciever
inputStarted
in interface ControlledInputReciever
ControlledInputReciever.inputStarted()
public boolean isAcceptingInput()
ControlledInputReciever
isAcceptingInput
in interface ControlledInputReciever
ControlledInputReciever.isAcceptingInput()
public void setInput(Input input)
ControlledInputReciever
setInput
in interface ControlledInputReciever
input
- The input instance sending eventsControlledInputReciever.setInput(org.newdawn.slick.Input)
public void inputEnded()
ControlledInputReciever
inputEnded
in interface ControlledInputReciever
ControlledInputReciever.inputEnded()
public abstract int getID()
GameState
getID
in interface GameState
GameState.getID()
public void controllerButtonPressed(int controller, int button)
ControllerListener
controllerButtonPressed
in interface ControllerListener
controller
- The index of the controller on which the control
was pressed.button
- The index of the button pressed (starting at 1)ControllerListener.controllerButtonPressed(int, int)
public void controllerButtonReleased(int controller, int button)
ControllerListener
controllerButtonReleased
in interface ControllerListener
controller
- The index of the controller on which the control
was released.button
- The index of the button released (starting at 1)ControllerListener.controllerButtonReleased(int, int)
public void controllerDownPressed(int controller)
ControllerListener
controllerDownPressed
in interface ControllerListener
controller
- The index of the controller on which the control
was pressed.ControllerListener.controllerDownPressed(int)
public void controllerDownReleased(int controller)
ControllerListener
controllerDownReleased
in interface ControllerListener
controller
- The index of the controller on which the control
was released.ControllerListener.controllerDownReleased(int)
public void controllerLeftPressed(int controller)
ControllerListener
controllerLeftPressed
in interface ControllerListener
controller
- The index of the controller on which the control
was pressed.ControllerListener.controllerLeftPressed(int)
public void controllerLeftReleased(int controller)
ControllerListener
controllerLeftReleased
in interface ControllerListener
controller
- The index of the controller on which the control
was released.ControllerListener.controllerLeftReleased(int)
public void controllerRightPressed(int controller)
ControllerListener
controllerRightPressed
in interface ControllerListener
controller
- The index of the controller on which the control
was pressed.ControllerListener.controllerRightPressed(int)
public void controllerRightReleased(int controller)
ControllerListener
controllerRightReleased
in interface ControllerListener
controller
- The index of the controller on which the control
was released.ControllerListener.controllerRightReleased(int)
public void controllerUpPressed(int controller)
ControllerListener
controllerUpPressed
in interface ControllerListener
controller
- The index of the controller on which the control
was pressed.ControllerListener.controllerUpPressed(int)
public void controllerUpReleased(int controller)
ControllerListener
controllerUpReleased
in interface ControllerListener
controller
- The index of the controller on which the control
was released.ControllerListener.controllerUpReleased(int)
public void keyPressed(int key, char c)
KeyListener
keyPressed
in interface KeyListener
key
- The key code that was pressed (@see org.newdawn.slick.Input)c
- The character of the key that was pressedKeyListener.keyPressed(int, char)
public void keyReleased(int key, char c)
KeyListener
keyReleased
in interface KeyListener
key
- The key code that was released (@see org.newdawn.slick.Input)c
- The character of the key that was releasedKeyListener.keyReleased(int, char)
public void mouseMoved(int oldx, int oldy, int newx, int newy)
MouseListener
mouseMoved
in interface MouseListener
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 mouseMouseListener.mouseMoved(int, int, int, int)
public void mouseDragged(int oldx, int oldy, int newx, int newy)
MouseListener
mouseDragged
in interface MouseListener
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 mouseMouseListener.mouseDragged(int, int, int, int)
public void mouseClicked(int button, int x, int y, int clickCount)
MouseListener
mouseClicked
in interface MouseListener
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 clickedMouseListener.mouseClicked(int, int, int, int)
public void mousePressed(int button, int x, int y)
MouseListener
mousePressed
in interface MouseListener
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 pressedMouseListener.mousePressed(int, int, int)
public void mouseReleased(int button, int x, int y)
MouseListener
mouseReleased
in interface MouseListener
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 releasedMouseListener.mouseReleased(int, int, int)
public void enter(GameContainer container, StateBasedGame game) throws SlickException
GameState
enter
in interface GameState
container
- The container holding the gamegame
- The game holding this state
SlickException
- Indicates an internal error that will be reported through the
standard framework mechanismGameState.enter(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame)
public void leave(GameContainer container, StateBasedGame game) throws SlickException
GameState
leave
in interface GameState
container
- The container holding the gamegame
- The game holding this state
SlickException
- Indicates an internal error that will be reported through the
standard framework mechanismGameState.leave(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame)
public void mouseWheelMoved(int newValue)
MouseListener
mouseWheelMoved
in interface MouseListener
newValue
- The amount of the wheel has movedMouseListener.mouseWheelMoved(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |