samples/hello_world/hello_dsl.rb in ray-0.0.1 vs samples/hello_world/hello_dsl.rb in ray-0.1.0.pre1
- old
+ new
@@ -1,24 +1,20 @@
-$: << File.expand_path(File.dirname(__FILE__) + "/../../lib")
-$: << File.expand_path(File.dirname(__FILE__) + "/../../ext")
+$:.unshift File.expand_path(File.dirname(__FILE__) + "/../../lib")
+$:.unshift File.expand_path(File.dirname(__FILE__) + "/../../ext")
-def path_of(res)
- File.expand_path(File.dirname(__FILE__) + "/../../spec/res/#{res}")
-end
-
require 'ray'
Ray::Game.new("Hello world!") do
register do
add_hook :quit, method(:exit!)
end
-
+
scene :hello do
- @font = font(path_of("VeraMono.ttf"), 12)
-
+ @font = Ray::Font.default
+
render do |win|
- @font.draw("Hello world", :on => win, :at => [0, 0])
+ @font.draw("Hello world", :on => win, :at => [0, 0], :size => 12)
end
end
-
+
push_scene :hello
-end
\ No newline at end of file
+end