Game Development Community

Can't resize pushed dialog?

by Anders · in Torque 3D Professional · 07/28/2010 (7:00 am) · 8 replies

I used Canvas.pushDialog() to display a gui I made. But I'm running into two separate extent problems. One, I can't seem to resize() whatever the top-level guicontrol that I pushed is, although I can resize its children.

Second, the GuiControl's extent seems to be defaulting to taking up half the screen, and setting Extent when I define the GuiControl doesn't change anything.

Anyone know what's going on?

#1
07/28/2010 (2:23 pm)
Can you post the contents of your gui file? That might help us determine whats going on.
#2
08/01/2010 (5:42 pm)

All toplevel GUI controls pushed onto the canvas are automatically resized to fit the GuiCanvas' extents. To push a smaller controller, simply wrap it in a GuiControl. Then you can freely resize and reposition that child control.

For the second problem, maybe your resizing behavior settings on the control get in the way of having it properly assume the extents of the outer GuiCanvas.
#3
08/18/2010 (2:47 am)
Thanks for the help! Here's where I'm at now:

%guiContent = new GuiControl(HudGui) {
new GuiWindowCtrl(ConvoOpenerGui) {
extent = "100 100";
};
};

When pushed with Canvas.pushDialog(HudGui), this produces a gui that fills the entire screen. That's fine, except that clicks won't pass through to the PlayGui beneath.

Is there any way to put gui elements for a HUD over the play area without having them take up the whole screen? I feel like I must be missing something obvious.
#4
08/18/2010 (2:57 am)

Use a profile on the wrapper control that let's input pass through, like GuiModelessDialogProfile.
#5
08/18/2010 (4:33 am)
Thanks, that worked! The container gui is still doing a weird thing where it turns visible whenever the cursor is over one of its children window, but I think I can figure that out with some fiddling.

Here's a question, though: I looked at where GuiModelessDialogProfile is defined in profiles.cs, and all it says is "modal = false;". But when I just add modal = false to my gui, it doesn't do the same thing as setting the gui's profile to GuiModelessDialogProfile. Why is this?
#6
08/18/2010 (4:40 am)

Quote:Here's a question, though: I looked at where GuiModelessDialogProfile is defined in profiles.cs, and all it says is "modal = false;". But when I just add modal = false to my gui, it doesn't do the same thing as setting the gui's profile to GuiModelessDialogProfile. Why is this?

You need to add modal=false to the profile, not the gui. Pretty much any profile with modal=false should work.
#7
08/18/2010 (4:41 am)
Oh, I see the structural distinction. Thanks!
#8
08/18/2010 (5:05 am)

Cool, glad it helped :)