Class ScreenPos

java.lang.Object
com.massifmaps.core.ScreenPos

public class ScreenPos extends Object
A screen position defined by x,y floating point numbers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a ScreenPos object.
    ScreenPos(float x, float y)
    Constructs a ScreenPos object from 2 coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    float
    Returns the x coordinate of this position.
    float
    Returns the y coordinate of this position.
    int
    Returns the hash value of this object.
    Creates a string representation of this screen position, useful for logging.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ScreenPos

      public ScreenPos()
      Constructs a ScreenPos object. All coordinates will be 0.
    • ScreenPos

      public ScreenPos(float x, float y)
      Constructs a ScreenPos object from 2 coordinates.
      Parameters:
      x - The x coordinate.
      y - The y coordinate.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getX

      public float getX()
      Returns the x coordinate of this position.
      Returns:
      The x coordinate of this position.
    • getY

      public float getY()
      Returns the y coordinate of this position.
      Returns:
      The y coordinate of this position.
    • toString

      public String toString()
      Creates a string representation of this screen position, useful for logging.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this screen position.