Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (734)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Mini Map?  (Read 2454 times)
0 Members and 1 Guest are viewing this topic.
Offline Zerolife

Senior Newbie

« Posted 2010-06-07 03:32:13 »

Im trying to make a mini map that is simply the graphics page I am drawing on scaled down to a certain part of the screen, obviously leaving the full image up. It is just going to show the parts of the graphics page that are drawn off screen. I can seem to figure it out though. I am using slick so you all know. If i wasn't using slick, I'd be able to do it as I've done it before, but the graphics and images in slick seem to be much different to increase speed, but its screwing me up -.-

Basically what I tried to do was create an image, and a graphics page, set the image and graphics to be identical, so whenever I draw on the graphics, it sends it to the image (graphics = image.getGraphics()) and then just draw the game to the graphics page, and draw the image to the screen, and draw the image again, but smaller on the gui. Any help is much appreciated.
Offline Nate

« JGO Bitwise Duke »

Medals: 167
Projects: 4
Exp: 14 years

Esoteric Software

« Reply #1 - Posted 2010-06-07 05:55:21 »

I would probably render twice, once for the main play area and once for the minimap. No fancy image buffers, just draw to the screen. Depending on your map size (probably large, since you want a minimap), you probably want to draw a lot less on the minimap anyway.

Offline appel

JGO Wizard

Medals: 73
Projects: 4

I always win!

« Reply #2 - Posted 2010-06-07 09:47:37 »

In short, you need two images, one that has the static background, and another that has the static background merged with the active game objects.

The static background image is only generated once, it contains the terrain of your map.
The merged image is generated every 500 milliseconds or so, you don' t need to do it real-time. Here you simply draw all the game objects you wish to show on the minimap, most commonly just a filled rectangle.

This is quite easy to do.

In slick you can easily create a Image and get it's graphics context to draw to, e.g.:

Image img = new Image(200,200);
Graphics g = img.getGraphics();

Check out the 4K competition @
Check out GAMADU (my own site) @
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

DarkCart (27 views)
2016-05-29 02:30:33

Hydroque (39 views)
2016-05-26 14:45:46

Mac70 (50 views)
2016-05-24 21:16:33

theagentd (55 views)
2016-05-14 18:38:35

theagentd (89 views)
2016-05-10 22:37:41

theagentd (95 views)
2016-05-10 22:33:46

IanParcs (121 views)
2016-04-18 14:18:53

KaiHH (116 views)
2016-04-18 08:35:41

KaiHH (136 views)
2016-04-15 12:43:58

theagentd (143 views)
2016-04-14 02:16:17
FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!