Changeset 123 for trunk/samples

Show
Ignore:
Timestamp:
08/21/2007 02:14:41 (13 months ago)
Author:
why
Message:

* shoes/ruby.c: basic shapes can now be positioned according to their center, better support for the attribute hash across paths.
* samples/: updated some samples to use the attr hashes.

Location:
trunk/samples
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/samples/bounce.rb

    r120 r123  
    1515      ydir *= -1 if y > self.height - size or y < 0 
    1616 
    17       oval x + size / 2, y + size / 2, size, size 
     17      oval :left => x + size / 2, :top => y + size / 2, :radius => size, :center => true 
    1818    end 
    1919  end 
  • trunk/samples/follow.rb

    r120 r123  
    1111      trails.each_with_index do |(x, y), i| 
    1212        i += 1 
    13         oval x, y, i, i 
     13        oval :left => x, :top => y, :radius => i, :center => true 
    1414      end 
    1515    end 
  • trunk/samples/rect.rb

    r120 r123  
    44    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 
    6     rect (10..100).rand, (10..200).rand, r, r 
     6    rect :left => (10..100).rand, :top => (10..200).rand, :width => r, :height => r 
    77  end 
    88  button "OK", :left => 300, :top => 400 do