LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Uli on October 12, 2007, 20:51:34

Title: using AWTGLCanvas for game/level editor
Post by: Uli on October 12, 2007, 20:51:34
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?
Title: Re: using AWTGLCanvas for game/level editor
Post by: princec on October 15, 2007, 10:31:57
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 :)
Title: Re: using AWTGLCanvas for game/level editor
Post by: Evil-Devil on October 17, 2007, 12:40:18
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.