Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (27 sloc) 932 Bytes

arc and cap

New arc and cap methods were released in the 970th build. See the following article:

http://newwws.shoooes.net/2008/09/10/arcs.html

And _why shows us a wonderful combination with the animate method.

# sample35.rb
Shoes.app :width => 200, :height => 100, :title => 'Arc' do
  fill green.to_s..yellow.to_s, :angle => 45
  stroke red.to_s..blue.to_s, :angle => 90
  strokewidth 10
  cap :round

  a = animate 12 do |i|
    @c.remove if @c
    r = i * (PI * 0.01)
    @c = arc 100, 50, 180, 60, 0, i * (PI * 0.01)
    a.stop if r >= TWO_PI
  end
end

sample35.png

sample35.png

Started....

sample35-1.png

sample35-1.png

Almost finished....

Policeman

The sample35.rb worked well with Shoes-0.r1263.