Game Development Community

GuiScrollCtrl or guiTextListCtrl bug

by Duncan Gray · in Torque Game Engine · 02/03/2006 (1:01 am) · 2 replies

My start mission screen displays a list of all missions available. I used to have 24 missions but I now have 32 and noticed that the scoll list only displays up to 24 missions when first entering the screen, but if I exit that screen and return, I can then scroll the full 32 missions instead of just 24.

I debugged it through the scripts and narrowed it down to being a C++ problem because all 32 mission items do get added to the guiTextListCtrl but for some reason, guiScrollCtrl only shows 24 on first show and then everything is available on next visit. Something to do with parent not being updated correctly with child control size data.

I have more pressing matters to address than a gui control, so hopefully someone had this bug before and can point to a fix. ;)

#1
02/15/2006 (12:08 pm)
Hey Duncan,

Can you maybe try this: go into the page that is displaying the 32 missions, go into the gui editor and then exit back out of the gui editor. Do all 32 missions show up? If so, the problem is simply a 'resize' issue. It seems like the element is not sized properly when it wakes up, but going into it a second time (or opening and closing the gui editor) resizes it properly. What you can do is add a call to 'resize' in that gui element's onWake function. You should be able to just give resize the elements current position and extent and it should work.

Now, since I don't have the mission list in my version of Torque and the default Torque only ships with a couple of missions, I can't confirm this fix for you, but I have had similar problems with other gui elements (the chat HUD, for one) where they were the incorrect size when they first awoke, but after openeing and closing the gui editor they magically resized.

Let me know if you have any questions about this...

Stephane
#2
02/15/2006 (12:50 pm)
Thanks for the reply Stephane. The problem seems to be with the control not resizing DOWN correctly, it does rezize UP.

I don't know why at this point, but I got around it by setting the legth etc while in 640-480 mode, then when I go to a higher resolution the "relative" sizing works fine. However, setting the srcoll control length while in 1024-768 resolution makes in fail in the above manner on lower screen reslutions.

So for now its OK but I'll try your "call to 'resize' in that gui element's onWake function" idea if the problem comes back.