Minimap with mobile frame

Hi there!

I’m currently developing a game in Java and I think this is the right subforum for the following question:

I want to make a “minimap” which erm… maps another bigger map and has this feature: a mobile frame in it that translates its moves into moves of the bigger map, that tipically may be embedded in a scrollable pane. So it must work both ways I assume, when you scroll through the map, the frame also moves in the minimap.

I’m totally clueless about it

Thanks in advance!

  1. what?
  2. iterate through the big map’s elements one at a time and draw a 2x2 or 1x1 rectangle with color depending on what is in the big map’s element. Like draw a green rect if its a grass tile. But I don’t really know what your asking.

I gather, maybe, that you want process clicks in the little map and translate them to the big map? You would do that the exact same way you do it on the big map. Just change tile size to 1 or 2 or however big each element on the little map is.

For scrolling, just find the starting X/Y and last X/Y that your large map is drawing, and draw the minimap based those.