Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: InCreator on Thu 22/11/2007 09:11:26

Title: Change label/buttongraphic when mouse over GUI button (SOLVED)
Post by: InCreator on Thu 22/11/2007 09:11:26
Title says it all.

I want to make some button onto my gui, and little help (not AGS text, but on a image) to change whenever mouse is over button.

For example, there's a disk shaped button, and when mouse is over it, a text "click here to save your game" appears.

How do I do it? Browsing help didn't help much.
I know how to change button graphics/label text, but can't figure out what the function is, to determine if mouse is over particular button or not.

I'm using older AGS, not 3.0
Title: Re: Change label/buttongraphic when mouse over GUI button
Post by: Buckethead on Thu 22/11/2007 09:45:42
I must be missing something here because isn't there just a "Mouseover image" function in the gui editor?  ???
Title: Re: Change label/buttongraphic when mouse over GUI button
Post by: Ashen on Thu 22/11/2007 11:30:33
Indded, there's the Button.MouseOverGraphic (http://www.adventuregamestudio.co.uk/manual/Button.MouseOverGraphic.htm) (settable in the editor) that should take care of that automatically.
However, it sounds like you want to change a different Button's graphic, depending on where the mouse is (e.g. if it's over btnSave, change btnDisplay to say "click here to save your game". If it's over btnLoad, change btnDisplay to say "click here to restore a saved game", etc.) In which case, use Button.GetAtScreenXY (http://www.adventuregamestudio.co.uk/manual/GUIControl.GetAtScreenXY.htm), passing the mouse coordinates. If that is what you're after, I'd think you'd be better using a label and changing it's Text property, instead of having to make images for every 'help' description.
Title: Re: Change label/buttongraphic when mouse over GUI button
Post by: InCreator on Fri 23/11/2007 02:58:02
Thanks, Ashen.