Rendering process in Star Ruby is executed through Textures. The final rendered window is achieved by layering textures on top of the main texture.
Render a image
At first we're going to write a code to render the image below(ruby.png) on the screen.

require "starruby"
include StarRuby
texture = Texture.load("ruby.png") # (1)
Game.run(320, 240) do
Game.screen.clear # (2)
Game.screen.render_texture(texture, 8, 8) # (3)
end
- (1)
-
Generate Texture object from PNG file. Please refer Texture Class in API Reference
- (2)
-
Game.screenis the texture which represents the screen itself. It is recommended you to callTexture#clearand clear the screen in the beginning of each frame, because the screen keeps the state of the previous frame. - (3)
-
Renders texture to the screen (
Game.screen). You callTexture#render_texturewhen you want to render from textures to textures. Second and third arguments represents X-coordinate and Y-coordinate of rendering position.
This is the screen after you execute the code above.

Move images
(coming soon)