ButtonBars lets you quickly and easily create nice-looking strips of clickable buttons. Normally when you write a game in the Sim City or RTS genre, you give the player lots of little buttons to click to perform various game functions. It can be very tedious defining all these buttons, and even worse if you decide you have to move them around, resize them, or make them look different!
ButtonBars makes it much easier. One line of code to create a button bar. One line of code for each button. That's it. When the user clicks a button, it executes whatever code you have specified. You don't have to mess with screen coordinates, mouse coordinates, drawing, or anything...just get on with the actual game.
Screenshot: (One bar, three buttons, one disabled)
And here's the code that produced it:
my_bar = bbar_add_bar("My Bar", bbar_skin_yellowmech); bbar_add_button(my_bar, "Button 1", "One", "show_message('Button 1 clicked')"); bbar_add_button(my_bar, "Button 2", "Two", "show_message('Button 2 clicked')"); bbar_add_button(my_bar, "Button 3", "Three", "show_message('Button 3 clicked')"); bbar_button_enable(my_bar, 3, false);
- Two built-in skins
- Multiple bars with as many buttons as you like
- Different button appearence for up, down, hover, and disabled
- Ability to use a sprite or text label on each button
- Ability to disable buttons
- Bars are movable and resizable with a single line of code
- Ability to use your own skin (with a little bit of graphical knowledge)
- More and better-looking skins
- Sound effects and animation
- Vertical bars
- Initial version
- Fixed a bug in bbar_add_skin where it crashed if you called it before bbar_add_bar, because ButtonBars was initializing from bbar_add_bar.