Interface TileObject

    • Method Detail

      • getHash

        long getHash()
        A bitfield containing various flags:
        
         (RL) plane = bits >> 49 & 3
         id = bits >> 17 & 0xffffffff
         wall = bits >> 16 & 1
         type = bits >> 14 & 3
         scene y = bits >> 7 & 127
         scene x = bits >> 0 & 127
         
        Type 0 = player, 1 = npc, 2 = game object, 3 = item
      • getX

        int getX()
        Gets the x-axis coordinate of the object in local context.
        See Also:
        LocalPoint
      • getY

        int getY()
        Gets the y-axis coordinate of the object in local context.
        See Also:
        LocalPoint
      • getZ

        int getZ()
        Gets the vertical coordinate of this object
      • getPlane

        int getPlane()
        Gets the plane of the tile that the object is on.
      • getWorldLocation

        @Nonnull
        WorldPoint getWorldLocation()
        Get the world location for this object. For objects which are larger than 1 tile, this is the center most tile, rounded to the south-west.
        Returns:
      • getLocalLocation

        @Nonnull
        LocalPoint getLocalLocation()
        Get the local location for this object. This point is the center point of the object.
        Returns:
      • getCanvasLocation

        @Nullable
        Point getCanvasLocation()
        Calculates the position of the center of this tile on the canvas
      • getCanvasLocation

        @Nullable
        Point getCanvasLocation​(int zOffset)
        Calculates the position of the center of this tile on the canvas
        Parameters:
        zOffset - Vertical offset to apply before projection
      • getCanvasTilePoly

        @Nullable
        Polygon getCanvasTilePoly()
        Creates a polygon outlining the tile this object is on
      • getCanvasTextLocation

        @Nullable
        Point getCanvasTextLocation​(Graphics2D graphics,
                                    String text,
                                    int zOffset)
        Calculates the canvas point to center text above the tile this object is on.
        Parameters:
        graphics - the graphics to use for font size calculation
        zOffset - Vertical offset to apply before projection
        Returns:
        the canvas point to draw the text at
      • getMinimapLocation

        @Nullable
        Point getMinimapLocation()
        Gets a point on the canvas of where this objects mini-map indicator should appear.
        Returns:
        mini-map location on canvas
      • getClickbox

        @Nullable
        Shape getClickbox()
        Calculate the on-screen clickable area of the object.