Java Code Examples for net.runelite.api.NPC#getGraphic()
The following examples show how to use
net.runelite.api.NPC#getGraphic() .
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: DevToolsOverlay.java From runelite with BSD 2-Clause "Simplified" License | 6 votes |
private void renderNpcs(Graphics2D graphics) { List<NPC> npcs = client.getNpcs(); for (NPC npc : npcs) { NPCComposition composition = npc.getComposition(); Color color = composition.getCombatLevel() > 1 ? YELLOW : ORANGE; if (composition.getConfigs() != null) { NPCComposition transformedComposition = composition.transform(); if (transformedComposition == null) { color = GRAY; } else { composition = transformedComposition; } } String text = composition.getName() + " (ID:" + composition.getId() + ")" + " (A: " + npc.getAnimation() + ") (P: " + npc.getPoseAnimation() + ") (G: " + npc.getGraphic() + ")"; OverlayUtil.renderActorOverlay(graphics, npc, text, color); } }
Example 2
Source File: FishingSpotMinimapOverlay.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
@Override public Dimension render(Graphics2D graphics) { if (hidden) { return null; } for (NPC npc : plugin.getFishingSpots()) { FishingSpot spot = FishingSpot.findSpot(npc.getId()); if (spot == null) { continue; } if (config.onlyCurrentSpot() && plugin.getCurrentSpot() != null && plugin.getCurrentSpot() != spot) { continue; } Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? config.getMinnowsOverlayColor() : config.getOverlayColor(); net.runelite.api.Point minimapLocation = npc.getMinimapLocation(); if (minimapLocation != null) { OverlayUtil.renderMinimapLocation(graphics, minimapLocation, color.darker()); } } return null; }