Last active
December 2, 2023 02:18
-
-
Save whity-82/5403900 to your computer and use it in GitHub Desktop.
Sample of drawing text with Gosu & Ruby.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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