Blinking Notification Graphic/Sprite/GUI [SOLVED]

Started by Monk, Sun 18/07/2010 15:08:16

Previous topic - Next topic

Monk

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!

Calin Leafshade

#1
something like this

Code: ags


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.

Code: ags


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");


Monk

Le hannon a tholel! again, you save my hide, it works like an amulet from the deep blue sea.. i appreciate it!

SMF spam blocked by CleanTalk