Skip to content

Instantly share code, notes, and snippets.

@whity-82
Last active December 2, 2023 02:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whity-82/5403900 to your computer and use it in GitHub Desktop.
Save whity-82/5403900 to your computer and use it in GitHub Desktop.
Sample of drawing text with Gosu & Ruby.
require 'gosu'
class GameWindow < Gosu::Window
def initialize
super 640, 480, false
self.caption = "Gosu Tutorial Game"
@font = Gosu::Font.new(self, Gosu::default_font_name, 20)
end
def update
end
def draw
@font.draw("Hello World!", 0, 0, 1, 1.0, 1.0, Gosu::Color::WHITE)
end
end
window = GameWindow.new
window.show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment