In this section you're going to write a program to show "Hello, World". Please use whatever text editor of your choice and write a ruby script.
require starruby library
require "starruby"
include StarRuby
require starruby.so module.
You choose to include Starruby here. Because we want to use the classes of Star Ruby without saying module name(StarRuby::). This line is not necessary if you're not going to omit module name.
Main loop
require "starruby"
include StarRuby
Game.run(320, 240) do
end
We added the main loop(Game.run) here. The arguments represent the screen size(width and height). The block which was passed to Game.run method (currently it is empty) will be called each frame (30ms as default) and executed.
Run this script. If you see a black window, you've succeeded.

Render Text
require "starruby"
include StarRuby
font = Font.new("MS UI Gothic", 12)
white = Color.new(255, 255, 255)
Game.run(320, 240) do
Game.screen.clear
Game.screen.render_text("Hello, World!", 8, 8, font, white)
end
Font class is needed when you want to render text. As an argument you can choose to pass a name of pre-installed fonts or path to TTF file. Second and third arguments represent the size of the font.
When using the color class, you need to pass the RGB value the new method. 255 is the maximum value you can pass. If all of the value are 255, it represents color white.
Game.screen is an object which keeps the output to the screen. You can control output by controling this object.
The block that was passed to Game.run method will be called each frame. At first we clear the screen (here we call clear method of Game.screen)。
In addition let's write a text on the screen. Please call render_text method. The second and third arguments represent the X and Y render coordinates respectively.
Now you can see "Hello, World!" on the screen!
