Resolution and guis
by PeterB · in Torque Game Builder · 11/02/2006 (4:02 pm) · 3 replies
When I change the screen resolution, my gui doesn't stay in proportion. I learned a lot about this from going through all the posts, but I'm not quite there.
If you look here:

...you see on the left how it's supposed to look. It looks great at 800x600.
I made a border around my game world by making a full screen image the parent (at 800x 600) of my t2dSceneWindow (which is just a little smaller). All sizing is set to 'width' and 'height'.
When I change resolution, the border image (parent) stays centered, but does not size properly.
Like at 1280x1024 you can see the border is inside the t2dSceneWindow (the grey border is because you're seing the white border through my translucent tilelayers):

In the next post I've included the gui as a text file:
If you look here:

...you see on the left how it's supposed to look. It looks great at 800x600.
I made a border around my game world by making a full screen image the parent (at 800x 600) of my t2dSceneWindow (which is just a little smaller). All sizing is set to 'width' and 'height'.
When I change resolution, the border image (parent) stays centered, but does not size properly.
Like at 1280x1024 you can see the border is inside the t2dSceneWindow (the grey border is because you're seing the white border through my translucent tilelayers):

In the next post I've included the gui as a text file:
About the author
#2
I had to set things to 'relative', rather than 'width', etc.
So the big lesson I learned before I posted this was to parent your gui elements properly. That got me 99% there but I didn't realize the 'relative' setting was the last step. ;)
11/02/2006 (5:21 pm)
FIXED IT!I had to set things to 'relative', rather than 'width', etc.
So the big lesson I learned before I posted this was to parent your gui elements properly. That got me 99% there but I didn't realize the 'relative' setting was the last step. ;)
#3
11/03/2006 (10:24 pm)
Glad you figured it out :) There are some helpful sizing options.
Torque Owner PeterB
//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(mainScreenGui) { canSaveDynamicFields = "0"; Profile = "GuiContentProfile"; HorizSizing = "width"; VertSizing = "height"; position = "0 0"; Extent = "800 600"; MinExtent = "8 8"; canSave = "1"; Visible = "1"; hovertime = "1000"; bitmap = "~/data/images/thebacki"; useVariable = "0"; tile = "0"; new GuiBitmapCtrl(border) { canSaveDynamicFields = "0"; Profile = "GuiDefaultProfile"; HorizSizing = "width"; VertSizing = "height"; position = "0 0"; Extent = "800 600"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; bitmap = "~/data/images/theborder.png"; wrap = "0"; new t2dSceneWindow(sceneWindow2D) { canSaveDynamicFields = "0"; Profile = "GuiContentProfile"; HorizSizing = "width"; VertSizing = "height"; position = "30 23"; Extent = "740 555"; MinExtent = "8 8"; canSave = "1"; Visible = "1"; hovertime = "1000"; lockMouse = "0"; useWindowMouseEvents = "1"; useObjectMouseEvents = "0"; new GuiStackControl(LBPlayWindowCtrlStack) { StackingType = "Horizontal"; HorizStacking = "Left to Right"; VertStacking = "Top to Bottom"; Padding = "4"; canSaveDynamicFields = "0"; Profile = "EditorButtonRight"; HorizSizing = "right"; VertSizing = "bottom"; position = "0 0"; Extent = "123 24"; MinExtent = "24 24"; canSave = "1"; Visible = "1"; hovertime = "1000"; new GuiTextCtrl(LBPlayWindowToolbarCaption) { canSaveDynamicFields = "0"; Profile = "EditorTextHLBoldCenter"; HorizSizing = "right"; VertSizing = "bottom"; position = "0 0"; Extent = "91 24"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; text = "Level Control"; maxLength = "1024"; }; new GuiIconButtonCtrl(LBPlayWindowStopBtn) { canSaveDynamicFields = "0"; Profile = "EditorButtonToolbar"; HorizSizing = "right"; VertSizing = "bottom"; position = "95 0"; Extent = "24 24"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; Command = "toggleLevelEditor();"; Accelerator = "escape"; hovertime = "1000"; groupNum = "-1"; buttonType = "PushButton"; buttonMargin = "4 4"; iconBitmap = "tools/leveleditor/gui/images/iconStop.png"; iconLocation = "Left"; sizeIconToButton = "0"; textLocation = "None"; textMargin = "4"; }; }; }; }; }; //--- OBJECT WRITE END ---