Forums Archived

The forums are being archived. See this topic for more information.

Rubygoo: GUI framework for Rubygame

Post about games, applications, etc. made with Rubygame. Feel free to promote your own projects here!

Rubygoo: GUI framework for Rubygame

Postby shawn42 » Tue Feb 10, 2009 8:46 pm

Rubygoo is a framework for building Rubygame apps. It allows for standard elements like buttons, text fields, etc.
It features an easily extended Widget class for rolling custom widgets yourself.

Get it:
http://code.google.com/p/rubygoo/
or
Code: Select all
gem install rubygoo


Sample code:
Code: Select all
    my_app = goo_app :renderer => renderer do

      label "click the button to set the time", :id => :display_label do
        x 20
        y 30
      end

      button "Click Me!", :id => :clicky do
        x 70
        y 80
        padding_left 20
        padding_top 20
        icon_image joystick_icon
        enabled false
      end

      icon do
        x 280
        y 80
        icon_image joystick_icon
      end

      # or use a hash to specify
      check_box :x=>370,:y=>70, :w=>20,:h=>20,:id=>:checky  do
        label_text "Check me out!"
      end

      # setup events
      get(:clicky).on :pressed do
        get(:display_label).set_text(Time.now.to_s)
      end
      get(:checky).when :mouse_enter do
        puts "ENTERING"
      end
      get(:checky).when :checked do
        get(:display_label).set_text("CHECKED [#{get(:checky).checked?}]")
        if get(:checky).checked?
          get(:clicky).enable
        else
          get(:clicky).disable
        end
      end
    end



Screen shot:
Image
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Return to Creations

Who is online

Users browsing this forum: No registered users and 1 guest

cron