public class View extends java.lang.Object implements Manager
Constructor and Description |
---|
View() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCamera(Camera camera)
Add a camera.
|
static void |
addInputProcessor(com.badlogic.gdx.InputProcessor processor)
Add an inputProcessor to the views.
|
static void |
classInit()
Shoud be called before the object get initialized.
|
void |
drawString(java.lang.String msg,
int xPos,
int yPos)
Draw a string using the last active color.
|
void |
drawString(java.lang.String msg,
int xPos,
int yPos,
com.badlogic.gdx.graphics.Color color)
Draw a string in a color.
|
void |
drawText(java.lang.String text,
int xPos,
int yPos,
com.badlogic.gdx.graphics.Color color)
Draw multi-lines with this method
|
void |
enter()
Should be called when the manager becomes active
|
static void |
focusInputProcessor(com.badlogic.gdx.InputProcessor processor)
Deactivates every input processor but one.
|
com.badlogic.gdx.graphics.g2d.SpriteBatch |
getBatch()
y-down
|
java.util.ArrayList<Camera> |
getCameras()
Returns a camera.
|
Controller |
getController() |
int |
getDrawmode() |
float |
getEqualizationScale()
The equalizationScale is a factor which scales the GUI/HUD to have the same relative size with different resolutions.
|
static com.badlogic.gdx.graphics.g2d.BitmapFont |
getFont() |
com.badlogic.gdx.graphics.OrthographicCamera |
getHudCamera() |
com.badlogic.gdx.graphics.glutils.ShapeRenderer |
getIgShRender() |
com.badlogic.gdx.graphics.glutils.ShapeRenderer |
getShapeRenderer()
Y-down
|
static com.badlogic.gdx.scenes.scene2d.ui.Skin |
getSkin() |
com.badlogic.gdx.scenes.scene2d.Stage |
getStage()
The libGDX scene2d stage
|
static com.badlogic.gdx.scenes.scene2d.Stage |
getStaticStage() |
void |
init(Controller controller)
Loades some files and set up everything.
|
boolean |
isInitalized() |
void |
render()
Main method which is called every time and renders everything.
|
static void |
resetInputProcessors()
Resets the input processors.
|
void |
resize(int width,
int height)
should be called when the window get resized
|
Coordinate |
screenToGameCoords(int x,
int y)
Returns the coordinates belonging to a point on the screen.
|
float |
screenXtoGame(int x,
Camera camera)
Reverts the perspective and transforms it into a coordiante which can be used in the game logic.
|
float |
screenYtoGame(int y,
Camera camera)
Reverts the perspective and transforms it into a coordiante which can be used in the game logic.
|
void |
setDrawmode(int drawmode)
The batch must be began before claling this method.
|
static void |
unfocusInputProcessor()
Reset that every input processor works again.
|
void |
update(float delta)
Updates every camera and everything else which must be updated.
|
public static void classInit()
public void init(Controller controller)
controller
- public static void resetInputProcessors()
public static void addInputProcessor(com.badlogic.gdx.InputProcessor processor)
processor
- public static void focusInputProcessor(com.badlogic.gdx.InputProcessor processor)
processor
- the processor you want to "filter"unfocusInputProcessor()
public static void unfocusInputProcessor()
focusInputProcessor(com.badlogic.gdx.InputProcessor)
public void update(float delta)
delta
- time since last update in ms.public void render()
public float getEqualizationScale()
public float screenXtoGame(int x, Camera camera)
x
- the x position on the screencamera
- the camera where the position is onpublic float screenYtoGame(int y, Camera camera)
y
- the y position on the screencamera
- the camera where the position is onpublic Coordinate screenToGameCoords(int x, int y)
x
- the x position on the screeny
- the y position on the screenpublic static com.badlogic.gdx.graphics.g2d.BitmapFont getFont()
public int getDrawmode()
public void setDrawmode(int drawmode)
drawmode
- public void drawString(java.lang.String msg, int xPos, int yPos)
msg
- xPos
- yPos
- public void drawString(java.lang.String msg, int xPos, int yPos, com.badlogic.gdx.graphics.Color color)
msg
- xPos
- yPos
- color
- public void drawText(java.lang.String text, int xPos, int yPos, com.badlogic.gdx.graphics.Color color)
text
- xPos
- space from leftyPos
- space from topcolor
- the colro of the text.public com.badlogic.gdx.graphics.OrthographicCamera getHudCamera()
public com.badlogic.gdx.graphics.g2d.SpriteBatch getBatch()
public com.badlogic.gdx.graphics.glutils.ShapeRenderer getIgShRender()
public com.badlogic.gdx.graphics.glutils.ShapeRenderer getShapeRenderer()
public Controller getController()
public java.util.ArrayList<Camera> getCameras()
protected void addCamera(Camera camera)
camera
- public void resize(int width, int height)
width
- height
- public com.badlogic.gdx.scenes.scene2d.Stage getStage()
public static com.badlogic.gdx.scenes.scene2d.Stage getStaticStage()
public static com.badlogic.gdx.scenes.scene2d.ui.Skin getSkin()
public boolean isInitalized()
isInitalized
in interface Manager