webDip dev coordination forum / public access todo list
It is currently Thu May 24, 2018 5:27 pm

All times are UTC

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Aug 30, 2008 12:35 am 

Joined: Fri Aug 29, 2008 11:58 pm
Posts: 4
For those browser capable of it, a javascript drag-drop interface.
This would require a major rework. I'm guessing that each map image is generated by php an then saved on the server so anyone can downlod it easily.

This would be changed for all browsers capable of displaying a gif , with transparency , floating in a specific position on top of another image. php could build the background image, but units and orders would be shown by overlaying separate gifs or pngs on top of the background image.
Although there is potentially a large number of possible moves, and an even larger number of possible supports, these images would never change and would soon be cached on the users computer. The page would contain these, but hidden until needed.

With a drag-drop interface you could paint the moves directly on screen by clicking and dragging units.

Each unit would be a separate image, positioned at the correct X Y coords relative to the background map image. (Which would be cleared of all previous orders prior to starting drag-drop move entering).
There would be a map for the background image (the game map), with an area for each country.

On "onmousedown" event for the unit, set the "onmouseover" event for all valid destinations for the unit.

The onmouseover event for these areas would make visible a move image, showing the order (as it would appear if executed). (gif or png with transparent background).

Releasing the mouse button (onmouseup) would set the order (set the value of the form fields), leaving the order image permanently visible. It would also reset the onmouseover events for the destinations. No communication with the server would happen until the user clicks "update orders".

Each move image would have a map area in the center of the arrow, which units could be dragged onto in order to support a move, in the same way as a move is created.

Support hold orders are indicated by dragging a unit to the unit to be supported.

If changing the onmouseover events is too tricky, set the unit being moved in a global variable and refer to that in the onmouseover event for that map area.

It is possible that move images would hide the countries map areas, making it impossible to move there. If this turns out to happen, you would have to create maps for those images that act like the country hidden.

PostPosted: Wed Sep 03, 2008 11:58 am 
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
I imagine this would be done using Canvas, which is a new HTML element which is designed for this sort of thing. See ... tbody.html for an example of the kind of thing you can do in Canvas.

This way everything could be drawn dynamically, and it wouldn't quite as messy as having multi-layered GIFs

But the basic idea of having drag and drop on the map would definitely be great, and you're right that it'd need quite a bit of work to server side code, and a totally new load of client side code

PostPosted: Thu Jun 14, 2012 7:48 am 

Joined: Sat May 05, 2012 12:31 pm
Posts: 61
Has anyone actually made this? If not I would be willing to try and come up with something.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group