I'm currently trying to implement a scrollable hexmap with LibGDX. The framework has some nice map apis but they seem to be pretty useless for what I want to do :(
An example of the map view that I would want. The pink rectangle represents the area actually visible on the screen while everything around will get cropped
This is a basic rundown of what my map needs to be able to do:
The map needs to be an Actor on the screen that can simply be drawn on a stage and be disposable. (Already have that)
The map needs to be scrollable. Meaning clicks and drags need to be registered.
The individual map tiles need to be clickable. When a tile is clicked, I would like to know what tile it was. (Edit: I can currently register clicks on the actor but I would have to manually calculate what tile was actually clicked. Is there a better way for this?)
Then, the map needs to know what tile is being displayed in the top left or right position to determine how many tiles to request from the QuadTree and essentially what to draw on screen.
The map data is stored in a quadtree. In the end there is a method I will have to call with what tiles I want to draw and the Quadtree will return the tiledata to me.
And last but not least: Tiles that reach outside the map boundries should be cropped (less priority)
Now. This is what I currently have:
http://pastebin.com/aqjSNPy3 (THe class is 200 lines long, not gonna spam this in here :) )
I can already draw the map actor on screen. It looks ugly as hell but what the heck. Not important now. I think the most important thing for now would be to register clicks on tiles, figure out how many tiles to display/ request and maybe do something with the camera to make it scrollable?
I'm really kinda out of answers here. Help will be highly appreciated. Thanks alot!