GUIControl layer property work?
by rwillis · in Torque X 2D · 11/06/2008 (9:27 pm) · 3 replies
Since I've been using torqueX i've never been able to get the layer property of GUIControls to work. Is this broken? If so, is there a fix? It seems to me the only way to control the layering of GUIControls is to control the order in which they're instantiated, but obviously that's not something I want to do.
About the author
#2
John K.
12/15/2008 (4:49 pm)
I thought that this was working. Can you give an example of what you're trying to do? Also, instead of layering, does it help to change the hierarchy? So the control on top is set as a child to the control below it? to do so, you need to set the folder... childControl.Folder = parentControl. Just keep in mind that the position (0,0) for the child becomes relative to the parent control. John K.
#3
In this example GUBitmap "two" will always render above bitmap "one" because "two" was created after "one", even though "one" is supposed to be on top because of its layer setting:
12/15/2008 (5:44 pm)
It looks like the order that GUIControls are created is the order they'll appear on top of each other on screen. The Layer property doesn't seem to make any difference in layering GUIControl's no matter what I change it to:In this example GUBitmap "two" will always render above bitmap "one" because "two" was created after "one", even though "one" is supposed to be on top because of its layer setting:
GUIBitmap one = new GUIBitmap(); one.Bitmap = @"data\images\one"; one.Visible = true; one.Style = style; one.Folder = this; one.Size = new Vector2(100,100); one.Position = new Vector2(50,50); one.Layer = 0; GUIBitmap two = new GUIBitmap(); two.Bitmap = @"data\images\two"; two.Visible = true; two.Style = style; two.Folder = this; two.Size = new Vector2(100,100); two.Position = new Vector2(75,75); two.Layer = 3;
Torque Owner rwillis