Been playing with the thought of javascript game. Especially RTS types… the question is as followed.
How do i work on creating a draggable inner frame, similar to google maps?
The idea, is that there is an overlaying UI, and a much larger draggable map underneath. Sort of similar to your usual RTS games. However i been trying to figure a simple work around for such an interface. Is there a ready made API for something similar?, or would i need to do it from scratch?.
If possible, it should work on an iphone too =X
Additional info:
From what i know so far, it seems like google maps uses a draggable element placed ontop of the map, detecting the drag events. What i dun understand however, is how, it is still able to hit objects beneath it…
I just threw this together in a second:
http://jsfiddle.net/purmou/mrJtG/
It uses jQuery UI’s (http://jqueryui.com/home) “Draggable” function. Here’s the HTML and CSS:
And here’s the jQuery:
Take a look at the Draggable page here for further exploration.