Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: BorisZ on Sun 22/05/2005 15:58:26

Title: Status gui problem
Post by: BorisZ on Sun 22/05/2005 15:58:26
I made a status GUI to follow cursor once it is over a hotspot or object. And it's working perfectly, except it doesn't dissapear on time: for instance,  when I use move character blocking,  status GUI dissapears after moving is done and not before. I am not posting code here because it is standard GUI I got from tutorials somewhere in here.
Title: Re: Status gui problem
Post by: RickJ on Sun 22/05/2005 18:35:23
How / where are you turning the GUI off?
Title: Re: Status gui problem
Post by: Ishmael on Sun 22/05/2005 20:30:05
Add Wait(1); right after the GUI off command...
Title: Re: Status gui problem
Post by: BorisZ on Tue 24/05/2005 18:42:31
I am not turning GUI off. It is set to show hotspot/object name and if there is no hotspot, string is empty.

here is the code

string my_buffer;
GetLocationName(mouse.x, mouse.y, my_buffer);
SetLabelText(1, 0, my_buffer);

under repedeately execute, offcourse
Title: Re: Status gui problem
Post by: Scorpiorus on Sat 28/05/2005 13:24:37
You see, your status GUI is constantly updated each game loop in repeatedly_execute. But when a blocking command is underway the repeatedly_execute isn't invoked and thus the GUI isn't updated. Fortunately, a special repeatedly_execute_always function was introduced that's invoked each game loop, even when a blocking command is running. Just add that function into your global script and move all the GUI updating code in there:

function repeatedly_execute_always() {

   string my_buffer;
   GetLocationName(mouse.x, mouse.y, my_buffer);
   SetLabelText(1, 0, my_buffer);

}