I'm working on libgdx project. I basically recreate my game which I coded in xna to make it available for android. Here's the problem android has many screen resolutions, and I want to know how to get them.
i tried Gdx.graphics.getWidth()
or getHeight()
but it gives me null pointer exceptions.
public Player(Vector2 position){ this.pos = position; speed = 500; }
this is as you can see constructor for player class.Player p = new Player(new Vector2(224, 48));
and i have this in main class after class opens. i want to change that hardcoded numbers with screen width and height and modify it with basic - or + operators. \$\endgroup\$