net.petterroea.starterkit
Class Screen

java.lang.Object
  extended by net.petterroea.starterkit.Screen

public class Screen
extends java.lang.Object

Inspired(But not copied from) by Notch's Ludum dare game system. Game states are sorted into screens.
For example, one screen can be the main menu, one the options, and one the game itself.

Author:
petterroea

Constructor Summary
Screen()
           
 
Method Summary
 void focusGained(java.awt.event.FocusEvent e)
          Called when the game window gets focus.
 void focusLost(java.awt.event.FocusEvent e)
          Called when the game window looses focus.
 void keyTyped(java.awt.event.KeyEvent arg0)
          Called when a key is typed.
 void mouseClicked(java.awt.event.MouseEvent arg0)
          Called when the mouse is clicked.
 void mouseDragged(java.awt.event.MouseEvent arg0)
          Called when the mouse is dragged(Moved while a mousebutton is pressed).
 void mouseEntered(java.awt.event.MouseEvent arg0)
          Called when the mouse enters the game window.
 void mouseExited(java.awt.event.MouseEvent arg0)
          Called when the mouse exits the game window.
 void mouseMoved(java.awt.event.MouseEvent arg0)
          Called when the mouse is moved without a mouse button being pressed down.
 void mousePressed(java.awt.event.MouseEvent arg0)
          Called when a mouse button is pressed.
 void mouseReleased(java.awt.event.MouseEvent arg0)
          Called when a mouse button is released.
 void mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
          Called when the mousewheel is scrolled/moved.
 void tick(int delta, java.awt.Graphics g)
          Ticks/Updates the screen, is called every time the game updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Screen

public Screen()
Method Detail

tick

public void tick(int delta,
                 java.awt.Graphics g)
Ticks/Updates the screen, is called every time the game updates.
Override this if you want to have a screen that draws

Parameters:
delta - Time since last update in milliseconds
g - Graphics object

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
Called when the mousewheel is scrolled/moved. Override this if you want to listen to this.

Parameters:
arg0 - The event object

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent arg0)
Called when the mouse is dragged(Moved while a mousebutton is pressed). Override this if you want to listen to this.

Parameters:
arg0 - The mouse event object

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent arg0)
Called when the mouse is moved without a mouse button being pressed down. Override this if you want to listen to this.

Parameters:
arg0 - The mouse event object

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent arg0)
Called when the mouse is clicked. Override this if you want to listen to this.

Parameters:
arg0 - The mouse event object

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent arg0)
Called when the mouse enters the game window. Override this if you want to listen to this.

Parameters:
arg0 - The mouse event

mouseExited

public void mouseExited(java.awt.event.MouseEvent arg0)
Called when the mouse exits the game window. Override this if you want to listen to this.

Parameters:
arg0 - The mouse event

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
Called when a mouse button is pressed. Override this if you want to listen to this.

Parameters:
arg0 - The mouse event

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent arg0)
Called when a mouse button is released. Override this if you want to listen to this.

Parameters:
arg0 - The mouse event

keyTyped

public void keyTyped(java.awt.event.KeyEvent arg0)
Called when a key is typed. Not so smart to use, use Input.keys[] instead.
If you relly want it, override this if you want to listen to this.

Parameters:
arg0 - The key event

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Called when the game window gets focus. Override this if you want to listen to this

Parameters:
e - The focus event

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Called when the game window looses focus. Override this if you want to listen to this.

Parameters:
e - The focus event