Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In libgdx model-loader demo font.draw() is not putting "fps" text on screen

Tags:

java

text

libgdx

I am starting to work with libgdx. I opened the example model-loader in trunk (StillModelViewerGL20.java). In the source I see this code in the render callback:

batch.begin();  
font.draw(batch, "fps: " + Gdx.graphics.getFramesPerSecond(), 20, 30);    
batch.end();

But I do not see any text on screen. Is there something I need to fix in this example to see text displayed?

like image 400
shorenkov Avatar asked Jun 13 '12 13:06

shorenkov


2 Answers

Maybe the screen size is smaller than 20,30. Try to draw on 0, 0.

like image 166
Aliaaa Avatar answered Oct 13 '22 06:10

Aliaaa


check the order in which you draw your objects, and if this is corrected by changing.

like image 43
letroll Avatar answered Oct 13 '22 05:10

letroll