Forums Archived

The forums are being archived. See this topic for more information.

Can't create a screen object

Get help and support with Rubygame

Can't create a screen object

Postby Elegios » Sun Jun 28, 2009 11:17 am

When trying to follow kiba's rubygame book I encountered a problem. When trying to create a screen
Code: Select all
@screen = Screen.new [800, 600], 0, [Rubygame::HWSURFACE, Rubygame::DOUBLEBUF]
it throws an error: can't convert Array into Array (TypeError)
Does anyone know what this is caused by? The rubygame code uses a convert_to_array function on the [height, width] array it is sent, which probably can't convert between the ruby array and C array, but it worked yesterday (before I installed Ruby 1.9 I suspect).

Can anyone help?

Edit: After reinstalling ruby1.8 and using that version instead it works. Would seem to be a problem with 1.9 compatibility, which is strange as shawn42 apparently got it to work without seeing my error (unless I missed something).

/Elegios
Elegios
 
Posts: 2
Joined: Sat Jun 27, 2009 12:51 pm

Re: Can't create a screen object

Postby jacius » Tue Jun 30, 2009 3:13 am

Elegios wrote:... but it worked yesterday (before I installed Ruby 1.9 I suspect).

After you installed Ruby 1.9, did you recompile Rubygame to link against the Ruby 1.9 lib? It probably won't work if it was linked against Ruby 1.8 but running in Ruby 1.9.
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: Can't create a screen object

Postby Elegios » Tue Jun 30, 2009 10:37 am

I used the gem so probably not. Thanks.
Elegios
 
Posts: 2
Joined: Sat Jun 27, 2009 12:51 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron