using AWTGLCanvas for game/level editor

Started by Uli, October 12, 2007, 20:51:34

Previous topic - Next topic

Uli

I'm actually working on a level editor for my game. Does anyone have some example or hint about using AWTGLCanvas together with a JScrollPane and MouseListener?

princec

You won't be able to use a JScrollPane as such because it's a Swing lightweight component and the AWTGLCanvas is a heavyweight component. This means you'll have to wire up your own "scrolling" code by using a pair of scrollbars instead (yes! You knew there'd be a use for them one day!)

Using MouseListener is just like when using it any time else in AWT.

Cas :)

Evil-Devil

You can use the JScrollPane, but that leads to flicker. Better approach is like princec said to do it on your own.

To display Leightweight COntainer on top of a Heavyweight, you have to set the Leightweight to heavyweight first, if you like to show other components on top of your LWJGL Canvas.