Game Development Community

Detecting GUI is finished loading

by Michael Dolhon · in Torque Game Builder · 05/19/2006 (8:34 am) · 0 replies

I have spent the past few days looking all over for an answer for this...but have yet to come up with a good working solutions.

I currently have a GUI for my game that has a lot of controls and several large image files. The first time it is loaded up, the game will start running before the GUI has finished loading/rendering/etc. But after the file is in memory, it will run smoothly every time after that.

I would perfer to keep this as a GUI, and not convert it all to sprites (which I played around with and would be a solution to this).

I was trying to find a way of detecting that the GUI had finished loading all of its elements and then begin executing the game code. After I was unable to find anything, I switched to trying to find work arounds. One of the posts that I came across talked about preloading the gui images...I tried several different ways of doing this, but still ended up with the same problem. I tried adding in a GuiFadeInBitmapCtrl so I could use its 'done' property, hoping that it should only set that once everything else was loaded, but it would finish before everything was loaded and the only way I could get this to work was by setting the timing to several seconds...which then looks bad once everything is loaded into memory and your sitting there for several seconds waiting for the game to start. Also used a schedule to add a bit of a pause, but that of course produced the same issue as the GuiFadeInBitmapCtrl.

So I just wanted to try to get a better idea of the possibility of this or any existing methods using script before I started working on adding something to the engine source to achieve this goal.