Strange Gui Editor behavior
by Philip Bloom · in Torque Game Engine · 01/31/2006 (7:35 pm) · 1 replies
Had this weird thing tonight where gui elements would move themselves without being touched, even without a resolution change, when the gui editor was called. What I did that lead up to the problem:
Was editting a mainmenu gui (working up off the stock one) and placing the buttons (bitmapbuttonctrls) centered on the screen with a setting of relative, relative for positioning. Saved this and it did save the correct positions and display correctly... but...if I tapped F10 twice (opening and closing the gui editor without doing anything else), the last element would just randomly move.
Attempting to replicate it, I restarted and brought up the editor, added 1 to the extent width of it, applied, and then tapped f10 once. It looked just how it should. Tapped it twice more? Moved somewhere offscreen and resized. I've managed to have this replicate a number of times now, usually ending with the element offscreen, but not always.
If I was to guess, it looks as if it was applying a resolution adjustment on the relative,relative a second time despite the fact it's already been scaled to the appropriate resolution, this would explain it getting smaller and appearing moved up and closer to the left side (Reapplying an adjustment from 1024x728 to 640x480) and the opposite where it'd get huge but moved down and off the screen. I'm doing nothing particularly odd with this bitmapbuttonctrl as it has the precise same gui code as the other 5 nonmoving ones save the bitmap name, tooltip, and position. Don't think this is expected behaviour so tossing it here. This was not on a stock build, but aside from the lighting kit 1.4 merge (gotten off the site), there's been nothing done to the gui code or the editor code whatsoever.
Was editting a mainmenu gui (working up off the stock one) and placing the buttons (bitmapbuttonctrls) centered on the screen with a setting of relative, relative for positioning. Saved this and it did save the correct positions and display correctly... but...if I tapped F10 twice (opening and closing the gui editor without doing anything else), the last element would just randomly move.
Attempting to replicate it, I restarted and brought up the editor, added 1 to the extent width of it, applied, and then tapped f10 once. It looked just how it should. Tapped it twice more? Moved somewhere offscreen and resized. I've managed to have this replicate a number of times now, usually ending with the element offscreen, but not always.
If I was to guess, it looks as if it was applying a resolution adjustment on the relative,relative a second time despite the fact it's already been scaled to the appropriate resolution, this would explain it getting smaller and appearing moved up and closer to the left side (Reapplying an adjustment from 1024x728 to 640x480) and the opposite where it'd get huge but moved down and off the screen. I'm doing nothing particularly odd with this bitmapbuttonctrl as it has the precise same gui code as the other 5 nonmoving ones save the bitmap name, tooltip, and position. Don't think this is expected behaviour so tossing it here. This was not on a stock build, but aside from the lighting kit 1.4 merge (gotten off the site), there's been nothing done to the gui code or the editor code whatsoever.
Torque Owner Chris Labombard
Premium Preferred
I found no solution to this. I didn't put a lot of time into it though. There is another thread about this where Melv May replies which lead to a possible solution in the source, but I didnt investigate far enough to implement it.