Can I attach a schedule to GuiProgressCtrl?
by Steve Howson · in Torque Game Engine · 09/08/2005 (10:25 pm) · 2 replies
Hi all.
I've gotten scheduling to work and have noticed that there is a GUI control 'GuiProgressCtrl'.
Is that only for loading levels, or can I attach a schedule to it to use it for a certain amount of time?
For instance if I want to show the progress for 10 seconds, can I use it?
If so, could someone explain how?
I've searched for info on it and there is very little.
I found it in the scripts, but I can't figure out how to attach stuff to it.
Any help would be appreciated.
Steve
I've gotten scheduling to work and have noticed that there is a GUI control 'GuiProgressCtrl'.
Is that only for loading levels, or can I attach a schedule to it to use it for a certain amount of time?
For instance if I want to show the progress for 10 seconds, can I use it?
If so, could someone explain how?
I've searched for info on it and there is very little.
I found it in the scripts, but I can't figure out how to attach stuff to it.
Any help would be appreciated.
Steve
Torque 3D Owner Robert Blanchet Jr.
You could do this:
MyProgress.updateThread = MyProgress.schedule(1000, "update"); function MyProgress::update(%this) { // progress bar is a value between 0 and 1, // so increment by 1 and divide by 10 to // to coincide with a 10 seconds progress bar %this.current++; %newValue = %this.current / 10; // change the progress bar %this.setValue(%newValue); // call ourself 1 second later to update again %this.updateThread = %this.schedule(1000, "update"); } // if you need to cancel if(isEventPending(MyProgress.updateThread)) cancel(MyProgress.updateThread);