Package controller
Class MainController
java.lang.Object
com.badlogic.gdx.ScreenAdapter
controller.MainController
- All Implemented Interfaces:
com.badlogic.gdx.Screen
,IOnLevelLoader
public abstract class MainController
extends com.badlogic.gdx.ScreenAdapter
implements IOnLevelLoader
The heart of the framework. From here all strings are pulled.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.badlogic.gdx.graphics.g2d.SpriteBatch
The batch is necessary to draw ALL the stuff.protected DungeonCamera
protected EntityController
protected IGenerator
Generates the levelprotected com.badlogic.gdx.graphics.g2d.SpriteBatch
This batch is used to draw the HUD elements on it.protected HUDController
protected HUDPainter
Draws hudprotected LevelAPI
protected Painter
Draws objects -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
protected abstract void
endFrame()
final void
render
(float delta) Main game loop.void
setHudBatch
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) void
setSpriteBatch
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) protected abstract void
setup()
Methods inherited from class com.badlogic.gdx.ScreenAdapter
dispose, hide, pause, resize, resume, show
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface level.IOnLevelLoader
onLevelLoad
-
Field Details
-
batch
protected com.badlogic.gdx.graphics.g2d.SpriteBatch batchThe batch is necessary to draw ALL the stuff. Every object that uses draw need to know the batch. -
entityController
-
camera
-
painter
Draws objects -
hudBatch
protected com.badlogic.gdx.graphics.g2d.SpriteBatch hudBatchThis batch is used to draw the HUD elements on it. -
hudController
-
hudPainter
Draws hud -
levelAPI
-
generator
Generates the level
-
-
Constructor Details
-
MainController
public MainController()
-
-
Method Details
-
setup
protected abstract void setup() -
beginFrame
protected abstract void beginFrame() -
endFrame
protected abstract void endFrame() -
render
public final void render(float delta) Main game loop. Redraws the dungeon and calls the own implementation (beginFrame, endFrame and onLevelLoad).- Specified by:
render
in interfacecom.badlogic.gdx.Screen
- Overrides:
render
in classcom.badlogic.gdx.ScreenAdapter
- Parameters:
delta
- Time since last loop.
-
setSpriteBatch
public void setSpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) -
setHudBatch
public void setHudBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
-