January 5, 201610 yr 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, 201610 yr by KEVzilla
January 5, 201610 yr 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, 201610 yr by Explv
January 5, 201610 yr Author @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?
January 5, 201610 yr 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, 201610 yr by Explv
January 5, 201610 yr 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.
Create an account or sign in to comment