Class GameArea


  • public class GameArea
    extends java.lang.Object
    Encapsulates a set of tiles representing an area. Provides helper methods for checking containment, retrieval, and visualization.
    • Constructor Summary

      Constructors 
      Constructor Description
      GameArea()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(net.runelite.api.coords.WorldPoint point)
      Checks if the given world point is inside this area.
      net.runelite.api.coords.WorldPoint getRandomTile()
      Returns a random tile from the area.
      void render​(net.runelite.api.Client client, java.awt.Graphics2D graphics, java.awt.Color color, boolean outline)
      Visualizes the area on the game screen.
      void renderMinimap​(net.runelite.api.Client client, java.awt.Graphics2D graphics, java.awt.Color color)
      Renders the area on the minimap.
      GameArea subtract​(GameArea other)
      Removes the tiles of another area from this one (Difference).
      GameArea union​(GameArea other)
      Combines this area with another (Union).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GameArea

        public GameArea()
    • Method Detail

      • contains

        public boolean contains​(net.runelite.api.coords.WorldPoint point)
        Checks if the given world point is inside this area.
        Parameters:
        point - The world point to check
        Returns:
        true if the world point is contained within the set of tiles and false otherwise.
      • getRandomTile

        public net.runelite.api.coords.WorldPoint getRandomTile()
        Returns a random tile from the area.
        Returns:
        A random tile within the set of tiles
      • union

        public GameArea union​(GameArea other)
        Combines this area with another (Union).
        Parameters:
        other - Another game area to check the union of
        Returns:
        GameArea the union tiles of the two game areas (the tiles that overlap).
      • subtract

        public GameArea subtract​(GameArea other)
        Removes the tiles of another area from this one (Difference).
        Parameters:
        other - Another game area to check
        Returns:
        GameArea the tiles which are not in the other game area
      • render

        public void render​(net.runelite.api.Client client,
                           java.awt.Graphics2D graphics,
                           java.awt.Color color,
                           boolean outline)
        Visualizes the area on the game screen. This should be called from a RuneLite Overlay's render() method.
        Parameters:
        client - an instance of the game client
        graphics - The graphics context
        color - The fill color (alpha is handled automatically if needed, but best to pass a translucent color)
        outline - Whether to draw just the outline or fill the tiles
      • renderMinimap

        public void renderMinimap​(net.runelite.api.Client client,
                                  java.awt.Graphics2D graphics,
                                  java.awt.Color color)
        Renders the area on the minimap. This should be called from a RuneLite Overlay's render() method
        Parameters:
        client - an instance of the game client
        graphics - The graphics context
        color - The fill color (alpha is handled automatically if needed, but best to pass a translucent color)