Java Code Examples for net.runelite.api.GameObject#getLocalLocation()

The following examples show how to use net.runelite.api.GameObject#getLocalLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZalcanoOverlay.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
private void renderRedSymbols(Graphics2D graphics)
{
	List<GameObject> symbolsToRender = util.getRedSymbols();

	if (symbolsToRender != null)
	{
		for (GameObject gameObject : symbolsToRender)
		{
			final LocalPoint loc = gameObject.getLocalLocation();
			final Polygon poly = Perspective.getCanvasTileAreaPoly(client, loc, 3);
			if (poly != null)
			{
				OverlayUtil.renderPolygon(graphics, poly, new Color(249, 47, 30));
			}
		}
	}
}
 
Example 2
Source File: BlastFurnaceClickBoxOverlay.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
private void renderObject(GameObject object, Graphics2D graphics, Color color)
{
	LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
	Point mousePosition = client.getMouseCanvasPosition();

	LocalPoint location = object.getLocalLocation();

	if (localLocation.distanceTo(location) <= MAX_DISTANCE)
	{
		Shape objectClickbox = object.getClickbox();
		if (objectClickbox != null)
		{
			if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
			{
				graphics.setColor(color.darker());
			}
			else
			{
				graphics.setColor(color);
			}
			graphics.draw(objectClickbox);
			graphics.setColor(new Color(0xFF, 0, 0, 20));
			graphics.fill(objectClickbox);
		}
	}
}
 
Example 3
Source File: BlastFurnaceClickBoxOverlay.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private void renderObject(GameObject object, Graphics2D graphics, Color color)
{
	LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
	Point mousePosition = client.getMouseCanvasPosition();

	LocalPoint location = object.getLocalLocation();

	if (localLocation.distanceTo(location) <= MAX_DISTANCE)
	{
		Shape objectClickbox = object.getClickbox();
		if (objectClickbox != null)
		{
			if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
			{
				graphics.setColor(color.darker());
			}
			else
			{
				graphics.setColor(color);
			}
			graphics.draw(objectClickbox);
			graphics.setColor(new Color(0xFF, 0, 0, 20));
			graphics.fill(objectClickbox);
		}
	}
}