Changeset 352 for trunk/samples
- Timestamp:
- 12/10/2007 16:17:06 (9 months ago)
- Files:
-
- 1 modified
-
trunk/samples/clock.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/samples/clock.rb
r337 r352 3 3 # posted to the Shoes mailing list on 04 Dec 2007 4 4 # 5 Shoes.app :height => 2 50, :width => 250 do6 @radius, @centerx, @centery = 90, 12 0, 1305 Shoes.app :height => 260, :width => 250 do 6 @radius, @centerx, @centery = 90, 126, 140 7 7 stack :margin => 10 do 8 8 animate(8) do … … 10 10 clear do 11 11 draw_background 12 para @time.strftime("%a %b %d, %Y %I:%M:%S"), :align => "center" 12 stack do 13 background black 14 para @time.strftime("%a"), 15 span(@time.strftime(" %b %d, %Y "), :stroke => "#ccc"), 16 strong(@time.strftime("%I:%M"), :stroke => white), 17 @time.strftime(".%S"), :align => "center", :stroke => "#666" 18 end 13 19 clock_hand @time.sec + (@time.usec * 0.000001),2,30,red 14 20 clock_hand @time.min + (@time.sec / 60.0),5 … … 18 24 end 19 25 def draw_background 20 background rgb(2 40, 250, 210)26 background rgb(230, 240, 200) 21 27 22 28 fill white … … 28 34 29 35 stroke black 30 line(@centerx, @centery - 100, @centerx, @centery - 95) 31 line(@centerx - 100, @centery, @centerx - 95, @centery) 32 line(@centerx + 95, @centery, @centerx + 100, @centery) 33 line(@centerx, @centery + 95, @centerx, @centery + 100) 36 strokewidth 1 37 line(@centerx, @centery - 102, @centerx, @centery - 95) 38 line(@centerx - 102, @centery, @centerx - 95, @centery) 39 line(@centerx + 95, @centery, @centerx + 102, @centery) 40 line(@centerx, @centery + 95, @centerx, @centery + 102) 34 41 end 35 42 def clock_hand(time, sw, unit=30, color=black)
