feat: added cursor coordinates diplay
This commit is contained in:
parent
efe5635e05
commit
f921f922c0
31
core/src/sagittarius/model/MouseInfo.java
Normal file
31
core/src/sagittarius/model/MouseInfo.java
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue