#!/usr/bin/env ruby
#
# button.rb -- IKEGAMI Daisuke
#
# $Log$

require 'ming/ming'
include Ming

def make_rect(r, g, b)
  s = SWFShape.new
  s.set_right_fill(s.add_fill(r, g, b))
  s.move_pen_to(-50, -50)
  s.draw_line_to(50, -50)
  s.draw_line_to(50, 50)
  s.draw_line_to(-50, 50)
  s.draw_line_to(-50, -50)
  
  s
end

b = SWFButton.new
b.set_up(make_rect(0xff, 0, 0))
b.set_over(make_rect(0, 0xff, 0))
b.set_down(make_rect(0, 0, 0xff))
b.set_hit(make_rect(0, 0, 0))

m = SWFMovie.new
m.set_dimension(320, 240)
m.set_background(0xff, 0xff, 0xff)

i = m.add(b)
i.move_to(160, 120)

m.save('button.swf')
