GML How to create button ui

Ache

Member
I'm wanting to add button ui with effects to my game. I want to make the text change color and have to little icons appear next to it when selected. And I want you to select the buttons by using the arrow keys. But I don't have any idea how buttons work. I would appreciate an explanation or a guide. Thanks :)
 

samspade

Member
I'm wanting to add button ui with effects to my game. I want to make the text change color and have to little icons appear next to it when selected. And I want you to select the buttons by using the arrow keys. But I don't have any idea how buttons work. I would appreciate an explanation or a guide. Thanks :)
Do you want the buttons to work with both the mouse and the arrow keys or just one? If just the arrow keys, then putting everything into an array works. If both, it gets more complicated. The short version is I recommend using objects for buttons - you can do everything you want with them. And then using another object to monitor keyboard input and change which is the selected buttons.

This video will explain how I do the first part (buttons with animations, sound, etc):


And Here's a link to a more complete tutorial series on buttons. Towards the end I cover hooking up button objects to keyboard input.

 

Ache

Member
Do you want the buttons to work with both the mouse and the arrow keys or just one? If just the arrow keys, then putting everything into an array works. If both, it gets more complicated. The short version is I recommend using objects for buttons - you can do everything you want with them. And then using another object to monitor keyboard input and change which is the selected buttons.

This video will explain how I do the first part (buttons with animations, sound, etc):


And Here's a link to a more complete tutorial series on buttons. Towards the end I cover hooking up button objects to keyboard input.

Thanks! That's really helpful!
 

Ache

Member
Do you want the buttons to work with both the mouse and the arrow keys or just one? If just the arrow keys, then putting everything into an array works. If both, it gets more complicated. The short version is I recommend using objects for buttons - you can do everything you want with them. And then using another object to monitor keyboard input and change which is the selected buttons.

This video will explain how I do the first part (buttons with animations, sound, etc):


And Here's a link to a more complete tutorial series on buttons. Towards the end I cover hooking up button objects to keyboard input.

Would I start with the 2.3 tutorials or just watch the whole thing?
 

samspade

Member
2.3. Some of it will be irrelevant unfortunately, as this was during a transition time and so I was talking about the differences between the two versions, but most of it should be on point.
 
Top