Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Wiggles_Say on Mon 20/03/2006 11:57:40

Title: Button Image Changing
Post by: Wiggles_Say on Mon 20/03/2006 11:57:40
I'm designing a speech GUI for the top of the screen. I've got a button acting as an avatar for each character, but I can't change the image of the button because it's read-only. Is there anyway around this? Or completely different way of showing an image in a GUI?

Thanks in advance.
Title: Re: Button Image Changing
Post by: Gilbert on Mon 20/03/2006 12:15:10
Read-only? Did you mean changing the GUI button image in-game? The Graphic property is read-only because you can have different images for different instances of a button, so instead you need to use the NormalGraphic, MouseOverGraphic and PushedGraphic properties to set the images. Normally you may set NormalGraphic only (if the other Graphic properties were set to -1 the engine will just use NormalGraphic for these instances).
Title: Another Matter: Global Function Problems
Post by: Wiggles_Say on Mon 20/03/2006 12:57:30
Thanks Gilbot, I've got that working now. Another problem has arisen that I can't access my own functions from the room scripts. How do I get that to work?
Title: Re: Button Image Changing
Post by: Ashen on Mon 20/03/2006 13:05:45
BFAQ: Creating your own functions (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Creating_your_own_custom_functions) (you want the middle bit).

You need to import it into the Script Header (Ctrl-H) with the import command. You'd do the same for any ints you've created, except that they have to be exported from the Global Script first, using export.

Look up import and export in the manual for more details