I am following the "Learning LibGDX Game Development" book to make a simple game. I am in the menu creation section where we create a stage and render it with debug borders.
The book says to use Table.drawDebug(stage)
but this static method seems to have been removed from the frameworks Table
class entirely.
I am importing com.badlogic.gdx.scenes.scene2d.ui.Table
; below is my code:
@Override
public void render(float deltaTime) {
Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
if (debugEnabled) {
debugRebuildStage -= deltaTime;
if (debugRebuildStage <= 0) {
debugRebuildStage = DEBUG_REBUILD_INTERVAL;
rebuildStage();
}
}
stage.act(deltaTime);
stage.draw();
Table.drawDebug(stage);
}
The last line, Table.drawDebug(stage);
has the compilation error "The method drawDebug(ShapeRenderer) in the type Table is not applicable for the arguments (Stage)"
Is there a new way to draw the stage in debug mode?