I wonder how to make a minimap, just of curiosity.
In my theorie, all we have to do is to "capture" the objects on the screen, scale them and draw them again in a little rectangle in the lower left corner or so.
Robin wrote:You could do that, but isn't a mini map usually more symbolic than that? For example, drawing a little blue square instead of a fully drawn guy?
I think you're better off drawing your mini map separately.
Lol, obviously.
@Petunien:
I remember the old days, while I was working on a RTS.
I paused the project, since I was missing spare time. I might eventually be back on it.
Take a look inside the last attachment, there is a fully working example of minimap (look inside Scripts/map.lua file).
Hope that will help.
There are several ways to do it.
If mini-map is really only resize of "realmap" you should use same code as used in big map of course.
If as Robin suggest you replace graphic tile for other more geometric thing you could do another separate piece of code.
I personally would prefer use same piece of code and make an internal switch to display whatever I wanted with for example map:draw("normal") or even only map:draw() and map:draw("mini").
Petunien wrote:Oh, yes, I forgot.
I personally would prefer use same piece of code and make an internal switch to display whatever I wanted with for example map:draw("normal") or even only map:draw() and map:draw("mini").
coffee wrote:
There are several ways to do it.
If mini-map is really only resize of "realmap" you should use same code as used in big map of course.
If as Robin suggest you replace graphic tile for other more geometric thing you could do another separate piece of code.
I personally would prefer use same piece of code and make an internal switch to display whatever I wanted with for example map:draw("normal") or even only map:draw() and map:draw("mini").
I'd be wary of this approach. Yes you could use love.graphics.translate and love.graphics.scale to redraw the map, but you're drawing everything twice which could be slow unless you have some checks in place to see if in object is outside of the minimap's view rectangle.
I would prefer having two classes for each renderable object, say TankRenderer and TankMinimapRenderer then you would have MapRenderer and MinimapRenderer
bartbes wrote:If you really do a full-detail minimap, you're probably best off drawing to a canvas, then scaling that down for the minimap.
Oppositely, if you are making something with less fidelity you can just read the map data and display it using smaller graphics and then scale the movements any 'markers' such as unit positions for display on the map. Kind of like rendering parts of the game a second time, but much smaller.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
@Roland_Yonaba
I'll have a look on it. Thank you. Why do you not update your game to 0.8.0, so it's playable?
Much work?
Regarding the minimap.
I made one in the scale 1:5.
Ok, basically you can place 20px rectangles and they will be drawn also in the minimap in the lower left corner.
My question: Is there a better way (more "efficient", smaller, future-proof...) to do that, what I did in the attached *.love?