Primary GuiControl's size incapable of being controlled?
by Doctor Fail · in Torque 2D Beginner · 11/14/2013 (7:15 pm) · 3 replies
Alright, I've been looking through documentation and testing a little bit of this and that; I have had overwhelming success and hopefully I'll have a good enough understanding soon to share with others, but I need to know, for reference purposes:
Why is it that when you instantiate a new GuiControl that is not explicitly made the child of any other control, does it auto-size itself to the canvas? What I mean here is, for instance:
I create a GuiControl, set the extent to 200px by 200px, and yet it automatically sizes itself to fill the window.
This happens every time. I can easily deal with this by just using an invisible parent control and adding others to it; as I can size the children of this main control, just not the control itself, which is how the sandbox gui's appear to do it; but I would love to know why it does this?
Why is it that when you instantiate a new GuiControl that is not explicitly made the child of any other control, does it auto-size itself to the canvas? What I mean here is, for instance:
I create a GuiControl, set the extent to 200px by 200px, and yet it automatically sizes itself to fill the window.
This happens every time. I can easily deal with this by just using an invisible parent control and adding others to it; as I can size the children of this main control, just not the control itself, which is how the sandbox gui's appear to do it; but I would love to know why it does this?
#2
cannot remember .most probably this will work:
HorizSizing = "relative";
VertSizing = "relative";
11/15/2013 (12:55 am)
u have to setup proper value for HorizSizing and VertSizing fields.cannot remember .most probably this will work:
HorizSizing = "relative";
VertSizing = "relative";
#3
11/15/2013 (6:34 am)
Yeah, just make a control that fills the canvas, then put the "real" control in that one. Push and pop to your heart's content....
Doctor Fail
Any time I use GuiControl, it automatically sizes to the canvas, I cannot control the size of any instance of a normal GuiControl. If there are any other controls that do this, I'd like to know. Though, I assume i'll run into them sooner or later.