public class MouseInput
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
| Modifier and Type | Field and Description |
|---|---|
static int |
mouseX
The x position of the mouse cursor
|
static int |
mouseY
The y position of the mouse cursor
|
GameObject |
sonic
The game object the mouse is being used for
|
| Constructor and Description |
|---|
MouseInput()
The default constructor
|
MouseInput(java.awt.image.BufferedImage img,
GameObject sonic)
The general constructor used to create the object
|
| Modifier and Type | Method and Description |
|---|---|
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed AND released
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed and then the mouse moves
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component
|
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse moves
|
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released after being pressed
|
public static int mouseX
public static int mouseY
public GameObject sonic
public MouseInput()
public MouseInput(java.awt.image.BufferedImage img,
GameObject sonic)
img - The image that will be affectedsonic - The game object that will be affectedpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - Provided by Java and represents the mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - Provided by Java and represents the mouse eventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - Provided by Java and represents the mouse eventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - Provided by Java and represents the mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - Provided by Java and represents the mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - Provided by Java and represents the mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - Provided by Java and represents the mouse event