public class UserInterface extends java.lang.Object implements org.newdawn.slick.MouseListener, org.newdawn.slick.KeyListener, SaveElement
Constructor and Description |
---|
UserInterface(org.newdawn.slick.GameContainer gc,
CommandInterface cli,
Character player,
GameWorld gw)
UI constructor, calls all UI elements constructors
|
Modifier and Type | Method and Description |
---|---|
void |
closeAll()
Closes all UI windows
|
void |
draw(org.newdawn.slick.Graphics g)
Draws ui elements
|
void |
drawPointners()
Draws UI pointers, like destination point or target point
|
Camera |
getCamera()
Returns UI camera
|
java.lang.String |
getLoadName() |
org.w3c.dom.Element |
getSave(org.w3c.dom.Document doc)
Saves UI configuration to XML document element
|
java.lang.String |
getSaveName() |
static GameCursor |
getUiCursor()
Deprecated.
|
void |
inputEnded() |
void |
inputStarted() |
boolean |
isAcceptingInput() |
boolean |
isExitReq()
Checks if exit game is requested
|
boolean |
isLocked()
Checks if UI is locked
|
boolean |
isMouseOver()
Checks if mouse is over one of ui elements
|
boolean |
isPauseReq()
Checks if game pause is requested
|
void |
keyPressed(int key,
char c) |
void |
keyReleased(int key,
char c) |
void |
mouseClicked(int button,
int x,
int y,
int clickCount) |
void |
mouseDragged(int oldx,
int oldy,
int newx,
int newy) |
void |
mouseMoved(int oldx,
int oldy,
int newx,
int newy) |
void |
mousePressed(int button,
int x,
int y) |
void |
mouseReleased(int button,
int x,
int y) |
void |
mouseWheelMoved(int change) |
void |
setInput(org.newdawn.slick.Input input) |
void |
setLayout(UiLayout layout)
Sets specified UI layout
|
void |
setLock(boolean lock)
Lock on unlocks UI
|
boolean |
takeLoadReq() |
boolean |
takeSaveReq() |
boolean |
takeScreenshotReq()
Takes screenshot requested
|
void |
update(org.newdawn.slick.GameContainer gc)
Updates ui elements
|
public UserInterface(org.newdawn.slick.GameContainer gc, CommandInterface cli, Character player, GameWorld gw) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
gc
- Game container for superclass and ui elementscli
- Command line interfaceplayer
- Player charactergw
- Game worldorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public void draw(org.newdawn.slick.Graphics g)
public void drawPointners()
public void update(org.newdawn.slick.GameContainer gc)
public boolean isMouseOver()
public boolean isExitReq()
public boolean isPauseReq()
public boolean takeSaveReq()
public boolean takeLoadReq()
public java.lang.String getSaveName()
public java.lang.String getLoadName()
public Camera getCamera()
public boolean isLocked()
public boolean takeScreenshotReq()
public void setLayout(UiLayout layout)
layout
- UI layout to setpublic void setLock(boolean lock)
lock
- True to lock UI, false to unlockpublic void closeAll()
public void inputEnded()
inputEnded
in interface org.newdawn.slick.ControlledInputReciever
public void inputStarted()
inputStarted
in interface org.newdawn.slick.ControlledInputReciever
public boolean isAcceptingInput()
isAcceptingInput
in interface org.newdawn.slick.ControlledInputReciever
public void setInput(org.newdawn.slick.Input input)
setInput
in interface org.newdawn.slick.ControlledInputReciever
public void mouseClicked(int button, int x, int y, int clickCount)
mouseClicked
in interface org.newdawn.slick.MouseListener
public void mouseDragged(int oldx, int oldy, int newx, int newy)
mouseDragged
in interface org.newdawn.slick.MouseListener
public void mouseMoved(int oldx, int oldy, int newx, int newy)
mouseMoved
in interface org.newdawn.slick.MouseListener
public void mousePressed(int button, int x, int y)
mousePressed
in interface org.newdawn.slick.MouseListener
public void mouseReleased(int button, int x, int y)
mouseReleased
in interface org.newdawn.slick.MouseListener
public void mouseWheelMoved(int change)
mouseWheelMoved
in interface org.newdawn.slick.MouseListener
public void keyPressed(int key, char c)
keyPressed
in interface org.newdawn.slick.KeyListener
public void keyReleased(int key, char c)
keyReleased
in interface org.newdawn.slick.KeyListener
public static GameCursor getUiCursor()
public org.w3c.dom.Element getSave(org.w3c.dom.Document doc)
getSave
in interface SaveElement
doc
- Document for save game file