Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: bx83 on Fri 30/08/2019 02:06:27

Title: How do I make a checkbox gui control?
Post by: bx83 on Fri 30/08/2019 02:06:27
I've tricked taking button_onclick(), and changing the button graphic (from an empty box to a checked box and visa-versa), however it says '.Graphic is read only'.
What do I do? I can't change the button image, so I'm screwed it would appear.
Title: Re: How do I make a checkbox gui control?
Post by: Crimson Wizard on Fri 30/08/2019 02:19:30
From the manual:
Quote
readonly int Button.Graphic;

Gets the current image on a GUI button. If a value less than 1 is returned, then no image is currently displayed on the button.

This property is read-only; in order to set the image, you must use one of the NormalGraphic, MouseOverGraphic or PushedGraphic properties.
Title: Re: How do I make a checkbox gui control?
Post by: bx83 on Fri 30/08/2019 03:12:57
But will normalgraphic etc. change the image permenantly? Or will it just appears cheked at the moment I push it, and then unchecked?
Title: Re: How do I make a checkbox gui control?
Post by: Crimson Wizard on Fri 30/08/2019 03:15:33
Yes, it sets it permanently, same for other properties.
Title: Re: How do I make a checkbox gui control?
Post by: Khris on Fri 30/08/2019 03:48:12
Quote from: manualint Button.NormalGraphic;

Gets/sets the button's normal sprite (ie. the graphic used when the button is not pushed and the mouse is not over it).