Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gijs on Sun 01/01/2006 16:01:06

Title: button images
Post by: Gijs on Sun 01/01/2006 16:01:06
I've been looking around for answers but I couldn't find them.

This is what I want:
I have a gui whit a button(5). The image of that button is 160.

Now further in my game the player gives an inventory item to an npc. And when he does that I want the buttonpic to change to 161, but only if the buttonpic is 160. So not if it's 159 or 162 etc.

I hope you guys understand what I want.
Thanks :)
Title: Re: button images
Post by: Gilbert on Sun 01/01/2006 16:08:30
In that player gives the item to a npc action, script something like:
For V2.62 or before:
if (GetButtonPic(guinum,5,1)==160) GetButtonPic(guinum,5,1,161);
(where guinum is the number of the gui the button's on)


For V2.7 or later:
if (btnInvButt.Graphic==160) btnInvButt.Graphic=161;
(where btnInvButt is the script name of the button you set in the editor)
Title: Re: button images
Post by: Gijs on Sun 01/01/2006 16:39:07
It works. :)

First it said something with wrong parameter at getbuttonpic but I changed that to setbuttonpic.

Thank you very much.

I should have said what version I was using(2.62).
Title: Re: button images
Post by: Gilbert on Mon 02/01/2006 04:28:18
Yeah I made a typo, glad to hear you sorted it out. :)