feat: added cursor coordinates diplay

This commit is contained in:
Laureηt 2021-04-09 14:55:03 +02:00
parent efe5635e05
commit f921f922c0

View file

@ -0,0 +1,31 @@
package sagittarius.model;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.scenes.scene2d.Actor;
import sagittarius.SagittariusGame;
import sagittarius.view.GameScreen;
public class MouseInfo extends Actor {
// ---------- ATTRIBUTEs ----------
private BitmapFont font = new BitmapFont();
// ---------- METHODs ----------
@Override
public void draw(Batch batch, float parentAlpha) {
super.draw(batch, parentAlpha);
font.draw(batch, "screen=" + (int)GameScreen.screenCursor.x + "," + (int)GameScreen.screenCursor.y,
GameScreen.worldCursor.x, GameScreen.worldCursor.y + font.getCapHeight());
font.draw(batch, "world=" + (int)GameScreen.worldCursor.x + "," + (int)GameScreen.worldCursor.y,
GameScreen.worldCursor.x, GameScreen.worldCursor.y + font.getCapHeight()*2);
}
}