Interface WorldSize
- All Known Implementing Classes:
CameraControlledGameScreen,GameScreenWithHUD,ScalableGameScreen
public interface WorldSize
-
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.math.Vector2Converts the current mouse or touch position from screen coordinates into world coordinates.floatReturns the current mouse X position in world coordinates.floatReturns the current mouse Y position in world coordinates.com.badlogic.gdx.graphics.CameraReturns the combined matrix of the world camera.floatReturns the height of the virtual game world in world units.floatReturns the width of the virtual game world in world units.
-
Method Details
-
getWorldWidth
float getWorldWidth()Returns the width of the virtual game world in world units.- Returns:
- the world width
-
getWorldHeight
float getWorldHeight()Returns the height of the virtual game world in world units.- Returns:
- the world height
-
getMouseWorldPosition
com.badlogic.gdx.math.Vector2 getMouseWorldPosition()Converts the current mouse or touch position from screen coordinates into world coordinates.- Returns:
- a
Vector2representing the mouse position in world space
-
getMouseX
float getMouseX()Returns the current mouse X position in world coordinates.- Returns:
- the mouse X position in world space
-
getMouseY
float getMouseY()Returns the current mouse Y position in world coordinates.- Returns:
- the mouse Y position in world space
-
getWorldCamera
com.badlogic.gdx.graphics.Camera getWorldCamera()Returns the combined matrix of the world camera.This is used by the HUD to switch back to world rendering.
- Returns:
- the world camera's combined matrix
-