Package controller
Class HUDController
java.lang.Object
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<HUDElement>
,Collection<HUDElement>
,Set<HUDElement>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHUDController
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Keeps a set of HUD elements and makes sure they are drawn. -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.scenes.scene2d.ui.Label
drawText
(String text, String fontPath, com.badlogic.gdx.graphics.Color color, int size, int width, int height, int x, int y) Draws a given text on the screen.com.badlogic.gdx.scenes.scene2d.ui.Label
drawText
(String text, String fontPath, com.badlogic.gdx.graphics.Color color, int size, int width, int height, int x, int y, int borderWidth) Draws a given text on the screen.void
update()
Redraws the HUD and all HUD elements.
-
Constructor Details
-
HUDController
public HUDController(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Keeps a set of HUD elements and makes sure they are drawn.- Parameters:
batch
- the batch for the HUD
-
-
Method Details
-
update
public void update()Redraws the HUD and all HUD elements.- Overrides:
update
in classAbstractController<HUDElement>
-
drawText
public com.badlogic.gdx.scenes.scene2d.ui.Label drawText(String text, String fontPath, com.badlogic.gdx.graphics.Color color, int size, int width, int height, int x, int y, int borderWidth) Draws a given text on the screen.- Parameters:
text
- text to drawfontPath
- path to the fontcolor
- color to usesize
- font size to usewidth
- width of the text boxheight
- height of the text boxx
- x-position in pixely
- y-position in pixelborderWidth
- borderWidth for the text- Returns:
- Label (use this to alter text or remove the text later)
-
drawText
public com.badlogic.gdx.scenes.scene2d.ui.Label drawText(String text, String fontPath, com.badlogic.gdx.graphics.Color color, int size, int width, int height, int x, int y) Draws a given text on the screen.- Parameters:
text
- text to drawfontPath
- path to the fontcolor
- color to usesize
- font size to usewidth
- width of the text boxheight
- height of the text boxx
- x-position in pixely
- y-position in pixel- Returns:
- Label (use this to alter text or remove the text later)
-