MassRS Posted January 5, 2016 Posted January 5, 2016 How do I paint a NPC on the minimap and give it an other color on the screen?
KEVzilla Posted January 5, 2016 Posted January 5, 2016 (edited) Well first you have to make a method that will calculate a Entity's position to a Point of the minimap. Then you can just draw this point in the onPaint method. Edited January 5, 2016 by KEVzilla
Explv Posted January 5, 2016 Posted January 5, 2016 (edited) How do I paint a NPC on the minimap and give it an other color on the screen? @Override public void onPaint(Graphics2D g){ g.setColor(Color.RED); g.fill(new MiniMapTileDestination(getBot(), npc.getPosition()).getBoundingBox().getBounds2D()); } Edited January 5, 2016 by Explv 1
MassRS Posted January 5, 2016 Author Posted January 5, 2016 @Override public void onPaint(Graphics2D g){ g.setColor(Color.RED); MiniMapTileDestination npcTileDest = new MiniMapTileDestination(getBot(), npc.getPosition()); g.fill(npcTileDest.getBoundingBox().getBounds2D()); } Can I also use this method to paint the NPC it self on the screen instead of on the minimap?
Explv Posted January 5, 2016 Posted January 5, 2016 (edited) Can I also use this method to paint the NPC it self on the screen instead of on the minimap? For that you would do something like: g.fill(npc.getModel().getBoundingBox(npc.getGridX(), npc.getGridY(), npc.getZ())); Note: use g.fill to create a filled in rectangle, or g.draw if you just want the outline. Edited January 5, 2016 by Explv
DragonAlpha Posted January 5, 2016 Posted January 5, 2016 It's been a while since I've played with these methods, but if I remember correctly there is a drawModel() method. When you click the [x] NPCs debug option, it draws an outline around all NPC models in the game. I reversed OSBot and inserted code to see how it was doing this; there is an internal method called something like: GraphicUtilities.drawModel(obj, color, x, y) I am just going off memory here, but it was definitely the GraphicUtilities class.