Changeset 120 for trunk/samples

Show
Ignore:
Timestamp:
08/19/2007 17:59:05 (13 months ago)
Author:
why
Message:

* shoes/ruby.c: okay, using the Color class for everywhere colors are put to use.
* samples/: switched most of the examples to using the rgb and gray methods, though the old techniques are still good.

Location:
trunk/samples
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/samples/anim-move.rb

    r97 r120  
    11Shoes.app do 
    2   background "rgb(0, 0, 0)" 
    3   fill 1.0, 1.0, 1.0 
     2  background rgb(0, 0, 0) 
     3  fill rgb(255, 255, 255) 
    44  rects = [ 
    55    rect(0, 0, 50, 50), 
  • trunk/samples/bounce.rb

    r115 r120  
    88  animate(30) do 
    99    clear do 
    10       background "rgb(102, 102, 102)" 
     10      background rgb(102, 102, 102) 
    1111      x += xspeed * xdir 
    1212      y += yspeed * ydir 
  • trunk/samples/calc.rb

    r85 r120  
    4242 
    4343  stack :margin => 4 do 
    44     background "rgb(240, 240, 210)", :radius => 5 
     44    background rgb(240, 240, 210), :radius => 5 
    4545 
    4646    stack do 
  • trunk/samples/draw.rb

    r113 r120  
    11Shoes.app do 
    2   background "rgb(102, 102, 102)" 
    3   stroke 0, 0, 0 
     2  background "#999" 
     3  stroke "#000" 
    44  x, y = nil, nil 
    55  motion do |_x, _y| 
  • trunk/samples/edit.rb

    r27 r120  
    11str, t = "", nil 
    22Shoes.app :height => 500, :width => 450 do 
    3   background "rgb(77, 77, 77)" 
     3  background rgb(77, 77, 77) 
    44  stack :margin => 10 do 
    55    text "<span color='white'><span color='red' background='white'>TEXT EDITOR</span> * USE ALT-Q TO QUIT</span>" 
  • trunk/samples/follow.rb

    r108 r120  
    22Shoes.app do 
    33  nostroke 
    4   fill 1.0, 1.0, 1.0, 0.6 
     4  fill rgb(0x30, 0xFF, 0xFF, 0.6) 
    55  animate(24) do 
    66    trails.shift 
     
    88 
    99    clear do 
    10       background "rgb(51, 51, 51)" 
     10      background rgb(51, 51, 51) 
    1111      trails.each_with_index do |(x, y), i| 
    1212        i += 1 
  • trunk/samples/rect.rb

    r86 r120  
    22  20.times do 
    33    nostroke 
    4     fill (0.6..1.0).rand, (0.1..1.0).rand, (0.2..1.0).rand, (0.4..1.0).rand 
     4    fill rgb((0.6..1.0).rand, (0.1..1.0).rand, (0.2..1.0).rand, (0.4..1.0).rand) 
    55    r = rand(300) + 60 
    66    rect (10..100).rand, (10..200).rand, r, r 
  • trunk/samples/timer.rb

    r12 r120  
    11label, time = nil, Time.now 
    22Shoes.app :height => 150, :width => 250 do 
    3   background "rgb(240, 250, 208)" 
     3  background rgb(240, 250, 208) 
    44  stack :margin => 10 do 
    55    button "Start" do