Hot answers tagged libgdx
I figured out how to do it. I used an interface as shown at this link Basically, I created an interface in the core project, then for each back-end project I implements my interface. To change the orientation in Android is simple as shown here That is, setRequestedOrientation(ActivityInfo.<THE_ORIENTATION>)
the problem was in my images size , i set the viewport to be 800x480 but the images size was 800x420 , i just changed the images size to 800x480 and in setSize() i changed it like the following : sprite.setSize(1f, 1f * sprite.getHeight() / sprite.getWidth() ); and its work perfectly now.
Add this to your Sprite creation: spatial.rotate90(false); This will rotate the sprite's texture 90 degrees. From the docs: Rotates this sprite 90 degrees in-place by rotating the texture coordinates. This rotation is unaffected by setRotation(float) and rotate(float).
Only top voted, non community-wiki answers of a minimum length are eligible