Hot answers tagged libgdx
This can easily be done just with the bounds of the screen and the position of the sprite. The screen bounds can be stored in two variables, screenMin and screenMax, where screenMin contains the minimum X position of the screen and the minimum Y position of the screen, screenMax does likewise with the maximums. leftDistance = spritePos.x - screenMin.x; ...
Only top voted, non community-wiki answers of a minimum length are eligible