Package com.csse3200.game.minigames
Class MinigameRenderer
java.lang.Object
com.csse3200.game.minigames.MinigameRenderer
Class to help render minigame things for snake and birdie dash. Includes spritebatch and camera.
The camera allows resizing to be done easily.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRenderable
(MinigameRenderable renderable) Add a thing to render (class that implements MinigameRenderable with render method)void
dispose()
Dispose of the sprite batchcom.badlogic.gdx.graphics.OrthographicCamera
getCam()
Getter for the cameracom.badlogic.gdx.graphics.g2d.SpriteBatch
getSb()
Getter for the sprite batchvoid
render()
Render all classesvoid
Render background for sprite batchvoid
resize
(int width, int height) Resize the screen
-
Constructor Details
-
MinigameRenderer
public MinigameRenderer()
-
-
Method Details
-
addRenderable
Add a thing to render (class that implements MinigameRenderable with render method)- Parameters:
renderable
- class to render
-
render
public void render()Render all classes -
renderBackground
public void renderBackground()Render background for sprite batch -
resize
public void resize(int width, int height) Resize the screen- Parameters:
width
- new width of the screenheight
- new height of the screen
-
getSb
public com.badlogic.gdx.graphics.g2d.SpriteBatch getSb()Getter for the sprite batch- Returns:
- the sprite batch
-
getCam
public com.badlogic.gdx.graphics.OrthographicCamera getCam()Getter for the camera- Returns:
- the camera
-
dispose
public void dispose()Dispose of the sprite batch
-