[macruby-changes] [839] MacRuby/trunk/sample-macruby/HotCocoa/graphics

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 6 18:09:22 PST 2009


Revision: 839
          http://trac.macosforge.org/projects/ruby/changeset/839
Author:   lsansonetti at apple.com
Date:     2009-03-06 18:09:22 -0800 (Fri, 06 Mar 2009)
Log Message:
-----------
reorganizing the hotcocoa graphics examples

Added Paths:
-----------
    MacRuby/trunk/sample-macruby/HotCocoa/graphics/spirograph.rb

Removed Paths:
-------------
    MacRuby/trunk/sample-macruby/HotCocoa/graphics/text.rb

Copied: MacRuby/trunk/sample-macruby/HotCocoa/graphics/spirograph.rb (from rev 838, MacRuby/trunk/sample-macruby/HotCocoa/graphics/text.rb)
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/graphics/spirograph.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/HotCocoa/graphics/spirograph.rb	2009-03-07 02:09:22 UTC (rev 839)
@@ -0,0 +1,31 @@
+#!/usr/bin/env macruby
+require 'hotcocoa/graphics'
+include HotCocoa
+include Graphics
+
+OUTFILE = 'spirograph.png'
+
+# set up the canvas and font
+canvas = Canvas.for_image(:size => [400,400], :filename => OUTFILE) do
+  background(Color.beige)
+  fill(Color.black)
+  font('Book Antiqua')
+  fontsize(12)
+  translate(200,200)
+
+  # rotate, draw text, repeat
+  180.times do |frame|
+    new_state do
+      rotate((frame*2) + 120)
+      translate(70,0)
+      text('going...', 80, 0)
+      rotate(frame * 6)
+      text('Around and', 20, 0)
+    end
+  end
+end
+
+# save the canvas
+canvas.save
+
+`open #{OUTFILE}`

Deleted: MacRuby/trunk/sample-macruby/HotCocoa/graphics/text.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/graphics/text.rb	2009-03-07 02:09:02 UTC (rev 838)
+++ MacRuby/trunk/sample-macruby/HotCocoa/graphics/text.rb	2009-03-07 02:09:22 UTC (rev 839)
@@ -1,31 +0,0 @@
-#!/usr/bin/env macruby
-require 'hotcocoa/graphics'
-include HotCocoa
-include Graphics
-
-OUTFILE = 'spirograph.png'
-
-# set up the canvas and font
-canvas = Canvas.for_image(:size => [400,400], :filename => OUTFILE) do
-  background(Color.beige)
-  fill(Color.black)
-  font('Book Antiqua')
-  fontsize(12)
-  translate(200,200)
-
-  # rotate, draw text, repeat
-  180.times do |frame|
-    new_state do
-      rotate((frame*2) + 120)
-      translate(70,0)
-      text('going...', 80, 0)
-      rotate(frame * 6)
-      text('Around and', 20, 0)
-    end
-  end
-end
-
-# save the canvas
-canvas.save
-
-`open #{OUTFILE}`
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090306/8b0e3a6c/attachment.html>


More information about the macruby-changes mailing list