Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / errors...
- - By timmcd Date 2009-10-01 23:52
My code causing the issue:
    7.times do |t|
      @anim <<,"images/#{t+1}.png", false)

main.rb:12:in initialize': Wrong arguments for overloaded method ''. (ArgumentError)
Possible C/C++ prototypes are: &window, VALUE source, bool tileable) &window, VALUE source, bool tileable, unsigned int srcX, unsigned int srcY, unsigned int srcWidth, unsigned int srcHeight)
  from main.rb:12:in
  from main.rb:12:in block in initialize'
  from main.rb:11:in
  from main.rb:11:in initialize'
  from main.rb:24:in
  from main.rb:24:in `<main>'

Whats up here?
Parent - By BlueScope Date 2013-02-18 22:40
Because this is quite an annoying thing to debug because of the vague error message, let whoever else finding this thread point in the right direction:
This happens if you try to initialize an image before you call the Window as a superclass, for example like this:

class Game < Window
  def initialize
    @image =, 'sprite.png')
    super(640, 480, false)

If you put the image after the super() call, it will work flawlessly - granted everything else is as it should be ;)
- By jlnr (dev) Date 2009-10-02 08:00
What is "self" in this context?
Up Topic Gosu / Gosu Exchange / errors...

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill