Jump to content


Photo

Buttonbars 0.11


  • This topic is locked This topic is locked
16 replies to this topic

#1 EricDB

EricDB

    Eric Burgess

  • GMC Elder
  • 920 posts
  • Version:GM8

Posted 21 April 2007 - 09:41 PM

<span style='font-size:14pt;line-height:100%'>ButtonBars v0.11</span>

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. :blink:

Download ButtonBars.gex

Screenshot: (One bar, three buttons, one disabled)
Posted Image

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);

Current features:
  • 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)
Planned features:
  • More and better-looking skins
  • Sound effects and animation
  • Vertical bars
Changes
v0.1
  • Initial version
v0.11
  • 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.

  • 0

#2 oakwhiz

oakwhiz

    GMC Member

  • New Member
  • 268 posts

Posted 03 May 2007 - 10:22 PM

Wow! Awesome! I never thought of this, but now that it's here I'm gonna use it!
  • 0

#3 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 25 June 2007 - 12:51 PM

"Very niize!" x]

Ye, that is a really sweet extention. :medieval:
  • 0

#4 spacerat

spacerat

    GMC Member

  • GMC Member
  • 233 posts

Posted 09 July 2007 - 10:08 AM

This is really useful, could save a lot of work in a current project. I noticed the bar was an object, so you can still do things like change it's position, destroy it, etc.

One question though, is it possible that you could release the source, or even just PM it to me if you don't want to release it publicly. It would be really grateful if you do, and will give full credit to you in anything I release with it.
  • 0
Registered GM 7 | Vista Ultimate X86 | Intel Core 2 Duo E6750 2.6 GHz FSB 1333 mhz | ASUS P5B-SE Motherboard | ATI Radeon HD 4870 512 MB | 4GB DDR2 667 Mhz Elixiar Ram | Realtek HD Audio | 1280x1024 ViewSonic VE710s LCD screen | Logitech MX 518 Mouse| Saitek Eclipse Keyboard Blue | AOL 8 Mb broadband| Ralink 58 Mb/s wireless PCI card | nEar 05 Classic studio speakers.

Anything else you need to know?

#5 jakman4242

jakman4242

    Vertical Shmup Junkie

  • New Member
  • 3222 posts

Posted 09 July 2007 - 11:03 PM

This looks awesome!
Except i can't download from redirecting links... will you please host this on rapidshare or somewhere else so i can download it?
  • 0
-- My blog. --

#6 blackkatco

blackkatco

    GMC Member

  • New Member
  • 6 posts

Posted 01 August 2007 - 05:27 AM

please add an example on adding bars.
  • 0

#7 mme

mme

    MME

  • GMC Member
  • 1012 posts

Posted 01 August 2007 - 09:00 AM

This looks awesome!
Except i can't download from redirecting links... will you please host this on rapidshare or somewhere else so i can download it?


I have added a mirror

http://mme.122mb.com.../ButtonBars.gex
  • 0
gmc_mdu2.pngrsa_gmc_sig.png

#8 tsa05

tsa05

    GMC Member

  • GMC Member
  • 1063 posts
  • Version:GM:Studio

Posted 25 August 2007 - 10:50 PM

I forgot to mention it the first time I downloaded this, but this is a really terrific extension. It's very flexible, and cleanly handles one of the major chores in game design.
  • 0

#9 cooldude2222

cooldude2222

    GMC Member

  • New Member
  • 250 posts

Posted 03 November 2007 - 04:37 AM

how do i change ths skin?

its very useful n nice but i dun wanna use the yellow bar

=S
  • 0

#10 ale646

ale646

    GMC Member

  • New Member
  • 98 posts

Posted 03 November 2007 - 02:12 PM

QUOTE(jakman4242)This looks awesome!Except i can't download from redirecting links... will you please host this on rapidshare or somewhere else so i can download it?

QUOTE(mme)
I have added a mirror http://mme.122mb.com.../ButtonBars.gex



I can't download it from that...
  • 0

#11 cooldude2222

cooldude2222

    GMC Member

  • New Member
  • 250 posts

Posted 03 November 2007 - 03:15 PM

how do i set the bar's position?
  • 0

#12 ale646

ale646

    GMC Member

  • New Member
  • 98 posts

Posted 04 November 2007 - 06:24 PM

Now I get “Error Loading: File was created with a newer version of game maker. Pleas get the new version from the web site.”
And I have got game maker 7 :) pro.
What is wrong?

Edited by ale646, 04 November 2007 - 06:25 PM.

  • 0

#13 cephei

cephei

    GMC Member

  • GMC Member
  • 801 posts

Posted 04 November 2007 - 06:31 PM

I have no idea. Works fine for me.

Mirror: http://www.box.net/shared/cgk3zo0gmd
  • 0

#14 ale646

ale646

    GMC Member

  • New Member
  • 98 posts

Posted 04 November 2007 - 07:15 PM

When I open it its a GM 6.1 file.
can it be that?
  • 0

#15 tristiano77

tristiano77

    GMC Member

  • GMC Member
  • 349 posts
  • Version:Unknown

Posted 04 November 2007 - 07:59 PM

good, but would be better if it didnt use execute_string()
  • 0

#16 tsa05

tsa05

    GMC Member

  • GMC Member
  • 1063 posts
  • Version:GM:Studio

Posted 06 December 2007 - 03:03 AM

Is there a way to change the font for the built-in skins? I tried bbar_skin_softblue.button_label_font=font0, and it had no effect. I've noticed that if the text is too big for the box, there's nothing you can do, since scaling the bar scales text as well... Also--is that vertical bar option still on the horizon?
  • 0

#17 mykl777

mykl777

    GMC Member

  • New Member
  • 5 posts

Posted 19 February 2008 - 07:24 PM

quite simply.....thank you............
  • 0