• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Buttons

V

Vyking

Guest
Heya, making a game that has several buttons, and when clicked I want it to show a green ring around the button so as to let the player know that the button is selected.

The problem is I've run into a few problems with this. I can't change sprites because I don't have the standard edition, and I've tried changing objects, but that doesn't seem to work. Also it seems that using the left button and left pressed events (on the mouse) make a difference.

Sorry if that was vague. Hopefully someone can help.

Thanks in advance.
 

Paskaler

Member
It would help to know what version of GameMaker tou are using, but I don't believe there is a limitation in any version which will not allow changing the sprite index of an object. Ayway, the difference between left button and left button pressed is that left button event triggers every step while LMB is down and left button pressed triggers only once when the button is pressed and it will trigger again if the button is released and then pressed again.
I recommend putting in your left button event this code:
Code:
sprite_index = spr_button_pressed
And add a left button released and add this code:
Code:
sprite_index = spr_button_released
 
Top