zooming in a 2D rts game in java
I am writing a 2D java RTS where every pixel represents a kilometer. It is a space game.
Everything is to that scale (realistic planets!), but I have a problem: I can't figure out how to make a minimap for it.
Since the minimap would be pathetically innacurate (even filling the 1024x768 screen it would still need every pixel to represent over 90,000KM!) I have decided to use the middle wheel of the mouse to make it zoomable.
Then a user can zoom out from 0 zoom (normal scale) to -12 AU zoom (the entire map fits on a 1024x768 screen) in 1 AU increments.
So, to make this happen....
- How do you scale images in Java2D?
- How can I change the distance between 2 objects on the screen without compromising their real distance from each other?
I thought of simply scaling the distances and image sizes down, but then realised that would bring units and planets closer together and my game engine would think they were right next to each other.
Complex problem, need help.
Thanks in advance.