Game Development Community

Odd change in GUI behavior in 1.1

by Rex Hiebert · in Torque 3D Professional · 06/17/2011 (12:20 pm) · 2 replies

I have a panel that the user can pop-up during the game. It then positions itself in the lower right corner. In 1.0.1 this was done by a setPosition(X,Y) in the onWake event. Worked fine.

In 1.1, the first time it pops up it is in the wrong position. If i toggle it on and off it then appears in the correct place. If, while it is off, I resize the screen and toggle the panel back on, it will again appear in the wrong place. Turning it off then on again fixes it. I've placed an echo command in there to report on the numbers it is calculating and they are correct. But something is happening that puts it in the wrong place.

#1
06/17/2011 (3:43 pm)
I believe that there was a bug fix for getPosition() and setPosition included in 1.1 so the behavior of these functions may be different. In the past these functions could return screen coordinates (ie: top left of display) instead of canvas coordinates (top left of playGui), as I recall. I haven't tried 1.1 yet so I'm not sure what they have put in as a fix.
#2
06/18/2011 (8:03 am)
That is exactly why I released this resource, I was having troubles with that, most were solved with ScreenToClient(), but not all.

Right, Left, Botton and Top Aligns

I made it for TGEA, but should pop right in to T3D from what I remember when I incorporated, if not let me know and I will post a T3D version.