The game map consists of tiles that are not all on screen. It is a turn based map, where the centre of screen should be the "focus" (The focus is displayed as a red box, highlighting the tile. Clicking a tile makes the tile the "focus", and should centre the screen, as well as update on the gui the tile location. Does anyone know good tutorials on this, for a turn based game, or what keywords whould i google for? My last attempt (now deleted) was based on a normal platformer game - "focus" wouldnt centre, and the mouseclicks always showed data on the tiles that are present on the first screen (top left), even if the screen was elsewhere.
I think your searchs may just be a bit to related to games.
When you think about it, this probable is inherient in any mapping or graphics applications. (Ignoring the turn based thing).
Have a look at photoshop, you have an image and an image naviagation box right? Which sounds a lot like what you want.
If you are doing 3D graphics, the area/window though which you are viewing the action, is the clipping plane, I dont know what it is called in 2D graphics.
I would think (and as I am not at home cant comfirm this), that Killer Games Programming in Java, should have a chapter on this.
All you are really doing is transforming the centre of the tile to the centre of the "clipping" plane. The centre of the clipping plane will always be constant. Or perhaps more correctly you are moving the centre of the "clipping" plane to the centre of teh clicked on title.
I would move the clipping plane rather then the "map".
Hope this helps a little. Gavin That is a simple transformation of a rectrangle.
This is my favorite tiny ad:
Devious Experiments for a Truly Passive Greenhouse!