Dual Screen Support

Greetings all.

I am interrested in being able to support dual-screen displays for developing my game map editor. My hope is to have my primary display show the map as it will appear in the game: full zoom, animations, and blackouts for the in-game UI. In the secondary display I would like to see my catalog of objects and tiles, a scalable mini-map ( perhaps two or three zoom levels ) and perhaps a small editor window to enter any scripts / events / notes I wish to attach to a particular object or to edit object attributes if appropriate.

Naturally, not everyone HAS dual displays and so I do not want this to be mandatory. I have it under two different setups ( my main computer runs a dual-head Nvidia card and my secondary environment is a laptop / monitor combo ) and once I’ve gotten use to the power of having two full size work areas I hate to go back. My work with video editing especially has brought home why I would like to make this available to myself as long as I can still function fine in single-screen mode.

My initial plan for a one-screen editor was to have the “secondary functions” ( object / tile selection, attributes, editor ) exist as tabed pannels on the right side of my screen or perhaps across the bottom. The mini-map would be a floating window I could drag to keep out of my way, and the rest of the real estate would be the editing window. Extending that I thought about making the secondary functions a separate window like the mini map so it could be manually drug over to the secondary window and adjusted. However, if there is any way for a program to detect dual-head displays at startup and adjust accordingly, similar to how we are detecting screen resolution, that would be ideal.

For myself I’m 99% on Linux in case it matters. Any input or suggestions from someone that has already looked at this or has experience / knowledge in this area is appreciated.

I too have a dual display setup and would never go back either. w00t.

If I remember correctly, you can use the fullscreen API to get access to the various screen devices on your system, so a list of available screens should be accessible through there. As far as allowing dual screen support, you’re right, just display the secondary stuff in a different window (i.e. for Swing, have a secondary “JFrame”), and it will be draggable like any other.

I don’t have any particular experience with, for example, writing code that would start the app, and move and maximize two different windows on two different displays, but I imagine it wouldn’t be too difficult. It may even be, when you query for the display resolution that it will return, for example, 1600x600 (if you’ve got 2 800x600 monitors configured to display next to one another). If that’s the case, maybe you could just set the initial position of the secondary frame to somewhere on the second monitor, and tell it to maximize.

Helpful?

Very helpful. Just not having an immediate reply of “sorry…you can’t do that” was nice. ;D

it’s going to be a little while before I have some “quiet time” to sit and play with this ( which is why I asked here rather than just testing myself ) but it sounds like I should be able to create a basic test that just checks and displays all supported resolutions and see what’s listed for my diffeent configs. From there I may be able to guesstimate window placement to put the secondary windows in teh right place at startup.

java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()

Here is a sample of the doc for java.awt.GraphicsDevice

Obviously I posted the question before diving into the docs or trying myself. I did admit that though. ::)

Since this is just for a map editor your pointer to the awt docs will probably be very much on-target.