com.golden.gamedev.object
Class GameCursor

java.lang.Object
  |
  +--com.golden.gamedev.object.Sprite
        |
        +--com.golden.gamedev.object.AnimatedSprite
              |
              +--com.golden.gamedev.object.GameCursor

public class GameCursor
extends AnimatedSprite

Rich graphics and animated mouse pointer, replacing standard windows mouse pointer.

GameCursor is extended from Sprite class, therefore it has all Sprite method except movement method. Sprite movement method is overriden to make this cursor always follow mouse coordinate.

See Also:
Game.hideCursor(), Game.showCursor()

Field Summary
protected  BaseInput input
           
 
Fields inherited from class com.golden.gamedev.object.Sprite
height, speedX, speedY, width
 
Constructor Summary
GameCursor(BaseInput input)
           
GameCursor(BaseInput input, BufferedImage[] cursor)
           
 
Method Summary
 boolean isVisible()
           
 void render(Graphics2D g)
           
 void setImages(BufferedImage[] cursor)
           
 void setLocation(int xs, int ys)
          Can not move mouse cursor directly, use BaseInput.mouseMove(int, int) instead.
 void setVisible(boolean b)
           
 void update()
           
 
Methods inherited from class com.golden.gamedev.object.AnimatedSprite
getAnimationTimer, getFrame, getImage, getImage, getImages, getTotalFrame, isAnimate, isLoopAnim, render, setAnimate, setAnimationTimer, setFrame, setImage, setLoopAnim, setTotalFrame, updateAnimation
 
Methods inherited from class com.golden.gamedev.object.Sprite
forceX, forceY, getBackground, getHeight, getID, getLayer, getMovementTimer, getOldX, getOldY, getScreenX, getScreenY, getSpeedX, getSpeedY, getWidth, getX, getY, isActive, isOnScreen, isOnScreen, move, moveX, moveY, setActive, setBackground, setID, setLayer, setMovementTimer, setSpeed, setSpeedX, setSpeedY, setX, setY, updateMovement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected final BaseInput input
Constructor Detail

GameCursor

public GameCursor(BaseInput input,
                  BufferedImage[] cursor)

GameCursor

public GameCursor(BaseInput input)
Method Detail

setLocation

public void setLocation(int xs,
                        int ys)
Can not move mouse cursor directly, use BaseInput.mouseMove(int, int) instead.

Overrides:
setLocation in class Sprite

setImages

public void setImages(BufferedImage[] cursor)
Overrides:
setImages in class AnimatedSprite

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean b)

update

public void update()
Overrides:
update in class AnimatedSprite

render

public void render(Graphics2D g)
Overrides:
render in class Sprite