2

I'm trying to learn some basics of Gosu. I can display images but when i try with text the application crashed. Here's a simple code i'm trying to run.

<!-- language: rb -->
require 'gosu'

class GameWindow < Gosu::Window
  def initialize(width=320, height=240, fullscreen=false)
    super
    self.caption = 'Hello'
    @message = Gosu::Image.from_text(self, "My text to print",Gosu.default_font_name,100)
  end

  def draw
    @message.draw(10, 10, 0)
  end
end

window = GameWindow.new
window.show

My system:

-Windows xp sp3

-ruby 1.93 448

-gosu 0.10.4

### cmd report image

### cmd report 2 image

Dark Hippo
  • 1,255
  • 2
  • 15
  • 35
  • This may be a platform specific issue. I'd suggest reinstall `gosu` gem, as sometimes minor library version changes may result in segfaults. Or try more recent Ruby version if possible. – joanbm Nov 14 '15 at 22:45
  • Thanks for your reply. As suggested i attempted to update ruby and to reinstall gosu. Sadly ruby versions over 2.0.0p647 doesn't work on xp. Anyway when i tried to reinstall gosu gem ruby gave some errors from converting some .so and .dll from ASCII-8Bit to UTF-8. – Scias Bof IV Nov 15 '15 at 07:20

2 Answers2

1

to everyone who have this problem on xp just install a previous version of gosu, with 0.9.2 works well.

Use: gem install gosu -v"0.9.2"

Arctia
  • 26
  • 1
0

Works fine for me

gosu 0.10.4

ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu]

Running on ubuntu

window

Damiano Stoffie
  • 897
  • 5
  • 8