Sorry this tutorial is quite basic, see here for a better one: http://code.google.com/p/gosu/wiki/RubyTutorial
Gosu has the following useful classes:
Window
Font
Image
Song
Sample
Window
The window is basically where the game is played. Kinda like what game.exe makes in RMXP.
You create it like so:
Image
To draw an image you use the following:
@image = Gosu::Image.new($window, "imagename", hardborders?)
@image.draw(x, y, z)
Font
Text is drawn just like an image.
@text = Gosu::Font.new($window, "text", height)
@text.draw(x, y, z)
Sound
There are two types of sound:
Song: imagine this as a BGM from RMXP.
Sample: imagine as a SE from RMXP.
@short = Gosu::Sample.new($window, "samplename")
@short.play
@long = Gosu::Song.new($window, "songname")
@long.play
Gosu has the following useful classes:
Window
Font
Image
Song
Sample
Window
The window is basically where the game is played. Kinda like what game.exe makes in RMXP.
You create it like so:
Code:
require 'gosu'
class GWindow < Gosu::Window
def initialize
super(width, height, fullscreen?)
self.caption = "caption"
end
def update
# update method
end
end
$window = GWindow.new
$window.show
Image
To draw an image you use the following:
@image = Gosu::Image.new($window, "imagename", hardborders?)
@image.draw(x, y, z)
Font
Text is drawn just like an image.
@text = Gosu::Font.new($window, "text", height)
@text.draw(x, y, z)
Sound
There are two types of sound:
Song: imagine this as a BGM from RMXP.
Sample: imagine as a SE from RMXP.
@short = Gosu::Sample.new($window, "samplename")
@short.play
@long = Gosu::Song.new($window, "songname")
@long.play