Game Development Community

GUI elements taking up the entire screen...

by Eric Knouff · in Torque Game Builder · 02/13/2008 (9:43 pm) · 2 replies

I usually try to fix these little problems by myself by searching the forums...but ive searched for hours now and cannot find a solution.

I have the problem of when I use Canvas.pushdialog(myGUI), it pushes my dialog to the ENTIRE screen. I design the GUI to be only 200 by 200 and it still displays taking up the entire scenewindow.

Does anyone have any idea whats going wrong? Why my GUI menu's are taking up the fullscreen?


Thanks in advance for any help!

About the author

Recent Threads


#1
02/14/2008 (10:15 am)
Two ways of using gui:
1. attach to existing "GUI" that "pushed to canvas"
2. actually, "push to canvas".

The first - you can use:
PlayGui.add(MyWindow);
In this case it will not be stretched, only "added" to become child of PlayGui.

The second - automatically makes the control to fit the full screen (as it's just another layer for whole canvas, like the PlayGui).
You need to make GuiControl (call it MyGuiDialog) and then all your required components to be inside that control.
Using Canvas.pushDialog(MyGuiDialog) in this case will make everything to be "correct".

You can check how the OptionsDlg is made and called.

Btw, making PlayGui.add(MyWindow) will "move" your gui control to the PlayGui, while using canvas.pushDialog - your control will still be a child of MyGuiDialog.

Hope this answers your question
#2
02/14/2008 (6:29 pm)
That helps quite a bit!

I was actually working with it a bit more today and found that using myGui.add() produces the proper result!


Thanks a lot!