Interface WorldSize

All Known Implementing Classes:
CameraControlledGameScreen, GameScreenWithHUD, ScalableGameScreen

public interface WorldSize
  • Method Summary

    Modifier and Type
    Method
    Description
    com.badlogic.gdx.math.Vector2
    Converts the current mouse or touch position from screen coordinates into world coordinates.
    float
    Returns the current mouse X position in world coordinates.
    float
    Returns the current mouse Y position in world coordinates.
    com.badlogic.gdx.graphics.Camera
    Returns the combined matrix of the world camera.
    float
    Returns the height of the virtual game world in world units.
    float
    Returns 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 Vector2 representing 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