Class ScreenUtils

java.lang.Object
net.storm.sdk.utils.ScreenUtils

public class ScreenUtils extends Object
Utility class for screen-related operations and validations.

This class provides methods for:

  • Checking if click coordinates are within valid screen bounds
  • Detecting clicks inside the minimap area
  • Retrieving minimap bounds for different client modes

These utilities are essential for validating click targets and ensuring interactions occur within appropriate screen regions.

See Also:
  • Constructor Details

    • ScreenUtils

      public ScreenUtils()
  • Method Details

    • isClickOffScreen

      public static boolean isClickOffScreen(net.runelite.api.Point point)
      Checks if a point is off the visible game screen.
      Parameters:
      point - the RuneLite Point to check
      Returns:
      true if the point is outside screen bounds, false otherwise
    • isClickOffScreen

      public static boolean isClickOffScreen(Point point)
      Checks if a point is off the visible game screen.
      Parameters:
      point - the AWT Point to check
      Returns:
      true if the point is outside screen bounds, false otherwise
    • isClickOffScreen

      public static boolean isClickOffScreen(int x, int y)
      Checks if coordinates are off the visible game screen.

      A point is considered off-screen if it has negative coordinates or exceeds the viewport dimensions.

      Parameters:
      x - the X coordinate to check
      y - the Y coordinate to check
      Returns:
      true if the coordinates are outside screen bounds, false otherwise
    • isClickInsideMinimap

      public static boolean isClickInsideMinimap(int x, int y)
      Checks if coordinates are inside the minimap area.
      Parameters:
      x - the X coordinate to check
      y - the Y coordinate to check
      Returns:
      true if the coordinates are within the minimap, false otherwise
    • isClickInsideMinimap

      public static boolean isClickInsideMinimap(Point point)
      Checks if a point is inside the minimap area.
      Parameters:
      point - the AWT Point to check
      Returns:
      true if the point is within the minimap, false otherwise
    • isClickInsideMinimap

      public static boolean isClickInsideMinimap(net.runelite.api.Point point)
      Checks if a point is inside the minimap area.
      Parameters:
      point - the RuneLite Point to check
      Returns:
      true if the point is within the minimap, false otherwise
    • getMinimap

      public static Rectangle getMinimap()
      Gets the bounding rectangle of the minimap.

      This method checks multiple possible minimap widget locations depending on the client mode (fixed, resizable, etc.). If no minimap widget is found, it returns a default rectangle in the top-right corner of the screen.

      Returns:
      the minimap bounds as a Rectangle