button images

Started by Gijs, Sun 01/01/2006 16:01:06

Previous topic - Next topic

Gijs

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 :)

Gilbert

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)

Gijs

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).

Gilbert

Yeah I made a typo, glad to hear you sorted it out. :)

SMF spam blocked by CleanTalk