Search in sources :

Example 51 with Polygon

use of java.awt.Polygon in project runelite by runelite.

the class TileIndicatorsOverlay method render.

@Override
public Dimension render(Graphics2D graphics) {
    LocalPoint dest = client.getLocalDestinationLocation();
    if (dest == null) {
        return null;
    }
    Polygon poly = Perspective.getCanvasTilePoly(client, dest);
    if (poly == null) {
        return null;
    }
    OverlayUtil.renderPolygon(graphics, poly, config.highlightDestinationColor());
    return null;
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) Polygon(java.awt.Polygon)

Example 52 with Polygon

use of java.awt.Polygon in project runelite by runelite.

the class OverlayUtil method renderTileOverlay.

public static void renderTileOverlay(Client client, Graphics2D graphics, LocalPoint localLocation, BufferedImage image, Color color) {
    Polygon poly = Perspective.getCanvasTilePoly(client, localLocation);
    if (poly != null) {
        renderPolygon(graphics, poly, color);
    }
    renderImageLocation(client, graphics, localLocation, image, 0);
}
Also used : Polygon(java.awt.Polygon)

Example 53 with Polygon

use of java.awt.Polygon in project runelite by runelite.

the class OverlayUtil method renderActorOverlayImage.

public static void renderActorOverlayImage(Graphics2D graphics, Actor actor, BufferedImage image, Color color, int zOffset) {
    Polygon poly = actor.getCanvasTilePoly();
    if (poly != null) {
        renderPolygon(graphics, poly, color);
    }
    Point imageLocation = actor.getCanvasImageLocation(graphics, image, zOffset);
    if (imageLocation != null) {
        renderImageLocation(graphics, imageLocation, image);
    }
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) Point(net.runelite.api.Point) Polygon(java.awt.Polygon)

Example 54 with Polygon

use of java.awt.Polygon in project runelite by runelite.

the class OverlayUtil method renderActorOverlay.

public static void renderActorOverlay(Graphics2D graphics, Actor actor, String text, Color color) {
    Polygon poly = actor.getCanvasTilePoly();
    if (poly != null) {
        renderPolygon(graphics, poly, color);
    }
    Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + 40);
    if (textLocation != null) {
        renderTextLocation(graphics, textLocation, text, color);
    }
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) Point(net.runelite.api.Point) Polygon(java.awt.Polygon)

Example 55 with Polygon

use of java.awt.Polygon in project runelite by runelite.

the class OverlayUtil method renderTileOverlay.

public static void renderTileOverlay(Graphics2D graphics, TileObject tileObject, String text, Color color) {
    Polygon poly = tileObject.getCanvasTilePoly();
    if (poly != null) {
        renderPolygon(graphics, poly, color);
    }
    Point minimapLocation = tileObject.getMinimapLocation();
    if (minimapLocation != null) {
        renderMinimapLocation(graphics, minimapLocation, color);
    }
    Point textLocation = tileObject.getCanvasTextLocation(graphics, text, 0);
    if (textLocation != null) {
        renderTextLocation(graphics, textLocation, text, color);
    }
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) Point(net.runelite.api.Point) Polygon(java.awt.Polygon)

Aggregations

Polygon (java.awt.Polygon)192 Point (java.awt.Point)53 Rectangle (java.awt.Rectangle)30 Graphics2D (java.awt.Graphics2D)28 Area (java.awt.geom.Area)22 ArrayList (java.util.ArrayList)21 BasicStroke (java.awt.BasicStroke)20 Color (java.awt.Color)19 Paint (java.awt.Paint)15 Point2D (java.awt.geom.Point2D)13 AffineTransform (java.awt.geom.AffineTransform)12 Rectangle2D (java.awt.geom.Rectangle2D)12 Shape (java.awt.Shape)11 LocalPoint (net.runelite.api.coords.LocalPoint)11 Point (net.runelite.api.Point)10 FloatPolygon (ij.process.FloatPolygon)9 Font (java.awt.Font)8 List (java.util.List)8 FontMetrics (java.awt.FontMetrics)7 Stroke (java.awt.Stroke)7