Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Monk on Sun 18/07/2010 15:08:16

Title: Blinking Notification Graphic/Sprite/GUI [SOLVED]
Post by: Monk on Sun 18/07/2010 15:08:16
hello,

got stuck on this one, i hope someone could educate me on this one.

i want to show a graphic/GUI everytime my character acquire an item or lost an item from the inventory, is it possible to do that?

ive tried creating a simple GUI and controlling it via guivisible true command but no dice, the guivisible false will kill it straight away!

looking forward to your answers,

thank you so much!
Title: Re: Blinking Notification Graphic/Sprite/GUI
Post by: Calin Leafshade on Sun 18/07/2010 15:40:09
something like this



function ShowGui(){

gGui.Visible = true;
SetTimer(1,120);

}

// and then in rep ex

function repeatedly_execute_always(){

if (IsTimerExpired(1)) gGui.Visible = false;

}



then just run ShowGui() and the gui will become visible for 120 game loops (3 seconds by default)

edit:

If you wanted to be snazzy you could do this.



function ShowGui(String txt){

Label1.Text = txt;
gGui.Visible = true;
SetTimer(1,120);

}

// and then in rep ex

function repeatedly_execute_always(){

if (IsTimerExpired(1)) gGui.Visible = false;

}



now you can just run ShowGui("Picked up the crowbar");

Title: Re: Blinking Notification Graphic/Sprite/GUI
Post by: Monk on Sun 18/07/2010 15:59:12
Le hannon a tholel! again, you save my hide, it works like an amulet from the deep blue sea.. i appreciate it!