Not logged inGosu Forums
Forum back to Help Search Register Login
Up Forum
1 2 3 4 5 Previous Next  
Topic Looking for a Gosu tutorial(Video or Text) By RunnerPack Date 2013-05-21 04:27
That's one way to do it, but that can get quite complicated/slow when you start using more than a few objects. Have a gander at: Gosu::Window#translate.

Use it like:

translate(world_x, world_y) {
  thing.draw(local_x, local_y, ...)

Keeping in mind, of course, that when the camera moves, e.g. right, the world "moves" left, and so on.
Topic Can I use Gosu to make an Isometric 2D game? By RunnerPack Date 2013-05-21 04:15
You can achieve * A N Y T H I N G * using Gosu! ;)

But seriously, yes you can. It's basically just a "top-down" perspective combined with the right graphical style (in fact, remember the dungeons in LoZ? The walls were top-down, but everything else was oblique!) The only semi-difficult thing is collision-detection, and then only if you want to be able to walk "behind" stuff (which LoZ games don't usually let you do).

If you want to do jumping or other "Z-axis" stuff, you just have to use the desired Z coordinate to modify the base Y coordinate. I've done this in Flash/AS3.
Topic Can I use Gosu to make an Isometric 2D game? By RunnerPack Date 2013-05-16 23:15
I think what you're referring to is called an "oblique projection". See:
Topic Looking for a Gosu tutorial(Video or Text) By RunnerPack Date 2013-05-16 23:11
You don't have to read the documentation "cover-to-cover" to learn from it. Just skim over the main classes (Window, Image, etc.) and look at the included examples. When you have a general idea of how things are done, start making something. If there's something you want to do, but you don't know how, take a look in the docs. There's really not that much to Gosu (on the surface) and it's really well organized and logical. You should be able to pick up the basics very quickly with just a bit of practice.

Also, don't forget to use the search engine here on the forum. Most likely, your question has already been asked and answered at least once.
Topic Bottomless Mine v.1.0-beta2 By RunnerPack Date 2013-04-23 01:03
I noticed another (minor) bug while watching his video: when you "print" the story text at the beginning, it looks like your code prints the "HTML" tags one character at a time, as well. Like I said, pretty minor compared to the door thing...

I hope you can get this working well on Windows (and all other platforms, of course). THE WORLD NEEDS MORE METROIDVANIA GAMES! ;)
Topic Additional Mouse Button Support By RunnerPack Date 2013-04-02 00:26
What's the syntax? The new documentation doesn't seem to list constants, and the rdoc in the gem doesn't seem to have been updated.

EDIT: Never mind; I found the hot-fix update thread...
Topic Gosu compatible gamepad controllers? By RunnerPack Date 2013-03-25 00:28
If your gamepad/joystick didn't come with any such software, you can always get "joytokey".
Topic Compiling Gosu 2D with MinGw on Windows By RunnerPack Date 2012-12-31 19:26
With a few changes to the makefile and source, I got the library to build using the Ruby Installer Devkit ( Once I get it working fully (including the Ruby wrapper) I'll attempt to update the wiki page.

I can also build the library in MSVC 2010 Express, but (I'm assuming) I need to build it using mingw in order to build the Ruby wrapper, which has to be built with mingw to work with the Ruby Installer binaries (which are built with mingw).

Right now, I'm stuck while trying to build the Ruby wrapper in the Devkit (mingw). I can't figure out, from the MSVC project, what exactly needs compiled/linked along with the generated wrapper code. Do I compile it according to the "Compiling your project" section of the wiki page?

Attempting to compile the wrapper (RubyGosu_wrap.cxx), I get the following:

$ gcc -o RubyGosu_wrap.o RubyGosu_wrap.cxx -I/c/Ruby/include/ruby-1.9.1/ -I.. -I. -I/c/RubyDK/include/
In file included from ../Gosu/Gosu.hpp:13:0,
                 from RubyGosu_wrap.cxx:2267:
RubyGosu_wrap.cxx: In function 'void Gosu::requireFreeImageFor(const char*)':
RubyGosu_wrap.cxx:2329:9: error: expected 'catch' before '__except'
RubyGosu_wrap.cxx:2329:9: error: expected '(' before '__except'
RubyGosu_wrap.cxx:2329:9: error: expected type-specifier before '__except'
RubyGosu_wrap.cxx:2329:18: error: expected ')' before '(' token
RubyGosu_wrap.cxx:2329:18: error: expected '{' before '(' token
RubyGosu_wrap.cxx:2329:37: error: 'GetExceptionCode' was not declared in this scope
RubyGosu_wrap.cxx:2330:9: error: expected ';' before '{' token

I even built my own copy of SWIG in mingw and generated the wrapper again...

Any help will be appreciated. Also, Happy 2013, everyone!
Topic Wrong window size By RunnerPack Date 2012-11-25 19:18
I started a (probably redundant) issue about this topic:
Topic Really simple 3D modeler By RunnerPack Date 2012-10-07 18:42
Wow, that is really impressive, so far! I can see this being used in some seriously good-looking and fun games.
Topic Really simple 3D modeler By RunnerPack Date 2012-10-04 23:57
I don't know how you forgot it, and I would also assume just about everyone's played it, but I thought it should be included for completeness ;)
Topic Really simple 3D modeler By RunnerPack Date 2012-10-04 01:42
A few more for your list:

Castlevania: Symphony of the Night

And, although technically 3D, this one is close enough to 2D, and pretty fun:

Machine Hunter

Also, I agree with your assessment of Rayman 2. I played it on Dreamcast; it's one of the system's best games.
Topic Gosu + RubyMotion? By RunnerPack Date 2012-09-11 18:53
I have no idea if it's directly related, but I found this (from 2008):

I tried to run it and (after a LOOONG wait) got this:

load: class org.jdesktop.applet.util.JNLPAppletLauncher not found.
java.lang.ClassNotFoundException: org.jdesktop.applet.util.JNLPAppletLauncher
  at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
  at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
  at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
  at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
  at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
  at sun.plugin2.applet.Plugin2Manager$ Source)
  at Source)
Exception: java.lang.ClassNotFoundException: org.jdesktop.applet.util.JNLPAppletLauncher

I really want Ruby+Gosu on Android (preferably in a compact form that can be uploaded to the Marketplace).
Topic TexPlay: now working in 1.9.3 By RunnerPack Date 2012-07-14 23:35
For the record, I just did this with the latest RubyInstaller and Devkit and it worked, unlike a charm. I extracted the FreeGlut stuff straight into the devkit root (C:\RubyDK on my system), since there were already bin, lib, and include dirs there, and ran the above command in an MSys terminal window with "/usr" as "/your/path/of/choice" like so:
ruby -S gem install texplay -- --with-opt-dir=/usr
BTW, XP Pro SP3.
Topic Ashton - shaders and framebuffers in Ruby By RunnerPack Date 2012-07-14 20:35
Maybe you could find a cheap system to drop that card into on craigslist.
Topic Ashton - shaders and framebuffers in Ruby By RunnerPack Date 2012-07-14 20:34
Actually, I used to be able to run jsb's Ruby shader stuff successfully using ruby-opengl, so I don't think it's a card/driver issue. But, if you want to skip adding support for older cards for right now, that's fine. Maybe I can help test/fix stuff once the lib's more mature. Thanks for helping me get the frame-buffer stuff working, at least.

EDIT: I just started fresh with the latest RubyInstaller (1.9.3) and Devkit. I installed Gosu, opengl, and ashton. The frame-buffer example runs fine (without bundler), but the rest of the examples give me this:

c:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/lib/ashton/base_shader.rb:34:in 'glBindFragDataLocationEXT': Extension GL_EXT_gpu_shader4 is not available on this system (NotImplementedError)

The good news is that jsb's shader stuff runs again, so I know I have some shader support. Whether it's enough to support what you want to do is another thing entirely...
Topic Ashton - shaders and framebuffers in Ruby By RunnerPack Date 2012-07-14 18:23
D:\rubydev\gosu\ashton>bundle exec ruby examples\framebuffer_example.rb

*** Runs great! No errors and a constant 59/60fps! ***

D:/rubydev/gosu/ashton/lib/ashton/framebuffer.rb:167:in 'create_framebuffer': undefined method 'glGenFramebuffersEXT' for #<Ashton::Framebuffer:0xe88450 @height=600, @width=800> (NoMethodError)
        from D:/rubydev/gosu/ashton/lib/ashton/framebuffer.rb:9:in 'initialize'
        from D:/rubydev/gosu/ashton/examples/framebuffer_example.rb:20:in 'new'
        from D:/rubydev/gosu/ashton/examples/framebuffer_example.rb:20:in 'initialize'
        from D:/rubydev/gosu/ashton/examples/framebuffer_example.rb:51:in 'new'
        from D:/rubydev/gosu/ashton/examples/framebuffer_example.rb:51:in '<main>'

D:\rubydev\gosu\ashton>cd c:\Ruby\lib\ruby\gems\1.9.1\gems\ashton-0.0.1alpha\examples

C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/lib/ashton/framebuffer.rb:143:in 'init_framebuffer': undefined method 'glGenFramebuffersEXT' for #<Ashton::Framebuffer:0xe98770 @height=600, @width=800> (NoMethodError)
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/lib/ashton/framebuffer.rb:21:in 'initialize'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/framebuffer_example.rb:20:in 'new'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/framebuffer_example.rb:20:in 'initialize'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/framebuffer_example.rb:49:in 'new'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/framebuffer_example.rb:49:in '<main>'

I would report the error, but when the problem is likely due to the age of my machine, I usually just try to modify my system to fix it, rather than trying to get developers to support my ancient and/or broken machine... :P

An example of this is when I hacked my registry to report a newer build date for my video driver to work around a lock-out in the Flash 11 3D hardware acceleration (it works fine, they just want fewer support emails from owners too dumb to update their video drivers).

I still haven't narrowed down the exact version of the nVidia drivers that produces the garbled graphics, but there may be newer drivers I can use. If I ever do find the first non-working version, I will report that to nVidia, since they claim the latest driver supports my card, and it clearly doesn't.
Topic Ashton - shaders and framebuffers in Ruby By RunnerPack Date 2012-07-14 17:23
1. ruby-opengl isn't installed.
2. Even the examples that came with the "opengl" gem don't work, so it's probably not Ashton's fault.
3. Ashton seems to build fine, but most of the unit tests fail due to the same undefined method 'version_supported?' for GL:Module error.
4. The "bundle" command gives:
D:\rubydev\gosu\ashton>bundle exec ruby examples/shader_image_example.rb
D:/rubydev/gosu/ashton/lib/ashton/shader.rb:309:in 'link': Shader link error: Fragment info (Ashton::ShaderLinkError)
(14) : error C5051: profile does not support conditional returns

        from D:/rubydev/gosu/ashton/lib/ashton/shader.rb:56:in 'initialize'
        from examples/shader_image_example.rb:24:in 'new'
        from examples/shader_image_example.rb:24:in 'initialize'
        from examples/shader_image_example.rb:74:in 'new'
        from examples/shader_image_example.rb:74:in '<main>'

It probably doesn't like my old video card. It's an AGP Geforce 6600 GT, and I have to run an older driver to prevent glitchy graphics.

Also, my Ruby environment is in a general state of disrepair. I may be reinstalling windows in the near future (to move to a new PC), so I'll just try again later with a fresh system. I hope I can get it working soon enough to help you tackle some "TODO" items (and solidify some of the wobbliness ;)
Topic Ashton - shaders and framebuffers in Ruby By RunnerPack Date 2012-07-13 23:54
First of all, thank you for doing this! I've been watching this thread since your first post, but I haven't been able to test it until now. It doesn't work for me, but I'm hoping there's a simple work-around.

I have the OpenGL gem you posted about in your "Game of Scones" thread (0.8.0.pre1 x86-mingw32) but I'm getting this error when I try to run the demos:

C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/lib/ashton/base_shader.rb:18:in initialize': undefined method version_supported?' for GL:Module (NoMethodError)
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/lib/ashton/shader.rb:23:in initialize'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/shader_image_example.rb:21:in
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/shader_image_example.rb:21:in initialize'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/shader_image_example.rb:41:in
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/ashton-0.0.1alpha/examples/shader_image_example.rb:41:in `<main>'

Any ideas? I'm really looking forward to seeing this working...
Topic Retina Support By RunnerPack Date 2012-05-22 02:07
I'm not trying to be a jerk. I just thought, for the sake of those searching later, there should be a post in this thread which actually contains the word "retina" spelled correctly. Sorry to bother you; carry on.
Topic Library linking errors on Windows By RunnerPack Date 2012-03-27 05:27
I compiled Gosu myself with MinGW (no NetBeans; just in a CMD terminal) and I still get the undefined references. At first, I suspected this was because some of the prereq's (e.g. FreeImage) are only supplied as COFF .lib's, but Gosu seemed to link with them fine, and some of the un. refs. are to Gosu itself.

I followed the Wiki stuff to get Gosu to build (which went very smoothly) but it's a bit vague on what to do after that (i.e. compiling something you wrote and linking to Gosu).

Any help from someone who's actually done this would be greatly appreciated!
Topic Exporting fonts By RunnerPack Date 2012-02-02 02:34
The default font doesn't look that bad... Can't you just re-wrap a few lines to make the text fit on the screen?
Topic Useful tools for game development By RunnerPack Date 2011-11-30 14:46
I haven't tried (or even downloaded) this yet, but it looks very useful. It's a work in progress, but it seems to already have some nice functionality.

It's AIR, so it runs on Mac/Win/whatever.
Topic Audio error By RunnerPack Date 2011-11-05 06:12
Did you go here, jlnr?

I don't know if it changes anything as far as adding support to libgosu, I just thought the "no royalties for less than 5000 units sold" thing was interesting...
Topic Set image transparency By RunnerPack Date 2011-09-29 04:34
It means "shift a number 24 bits to the left". It's shorthand for "multiply by 16777216". It seems to be a bit beyond your skill level at this point, but if you keep learning about programming you'll eventually get to binary math and it'll make sense. Just do it the "right" way using Gosu::Color.
Topic Set image transparency By RunnerPack Date 2011-09-29 04:30

I only did it to show how close his code was to working. He's obviously a newbie (no offense, Italian reaper dude) and I knew there would be other people spoiling him by coding it for him "the right way". This way, I thought he might at least learn something on his own, even if it's not directly "properly" applicable here...
Topic Set image transparency By RunnerPack Date 2011-09-26 23:13

@immagini_logo.draw(0, 0, 0, 1, 1, ((0xFF - $n) << 24) + 0xFFFFFF)

(Or use the the Color class like Dahrkael said).
Topic Gosu 0.7.36(.2) released By RunnerPack Date 2011-09-01 21:12
For animated GIF, I found this:

As the name implies, it's a self-contained GIF->Animated PNG converter. It's written in C and looks fairly portable. It would be a bit of work, but you could extract the GIF loading code from it. It might also be useful as a standalone program...
Topic Windows executable By RunnerPack Date 2011-08-10 01:35
I'm not sure I agree with "esoteric" but I'll take that as a compliment ;-)

However, I'm not really sure it's even a solution... I just tried the latest ReactOS in the latest VirtualBox. There was no working browser with which to download RubyInstaller, and the network subsystem doesn't seem up to the task of getting the file off of my Samba share. I suppose there's a way to do it with the live or installer CDs, but it seems like more work than it's worth, especially if you can get temporary access to a real Windows PC and do something like jlnr suggested (assuming that works).
Topic Windows executable By RunnerPack Date 2011-08-09 20:06
You could try ReactOS ( It's still in alpha, but RubyInstaller and its companion mingw32 shell probably don't do too many crazy things, OS-wise. I just tried it the other day under VirtualBox (just ReactOS, not Ruby) and it seemed to run quite nicely.
Topic Sample vs SampleInstance/Channel/Playback By RunnerPack Date 2011-08-08 04:36
I like both "Track" and "Channel." I'm leaning toward the latter, but there are arguments against both.

How about "Outburst"? Instead of Outburst#stop, you could use Outburst#stifle ;-)
Topic Has anyone tried Ruby2CExtension? By RunnerPack Date 2011-08-06 08:34
Yeah... which makes me wonder even more why no one's updated it. There must be quite a few changes between 1.8.x and 1.9 "under the hood" that directly affect this gem. *shrug*
Topic A Platformer! (my first game, be nice) By RunnerPack Date 2011-08-05 18:23
Sure, the graphics could be better, but it's still a pretty cool game! I like the eye patch; that's a nice touch... One thing though, where is he keeping his infinite supply of attack parrots?! ;-)

I might just fork this and work up some levels and stuff...
Topic Has anyone tried Ruby2CExtension? By RunnerPack Date 2011-08-05 17:04
I just found out about Ruby2CExtension (, and a search of the forum came up empty, so I thought I'd ask if anyone's tried it.

It only works with 1.8.x (1.8.4 or later, I think), but it could make a Ruby game a bit faster while also adding another layer of obfuscation to a distributed (commercial?) game.

I put it in my todo list, and I'll try to update this thread when I get around to testing it (if anyone cares).
Topic SongBugs By RunnerPack Date 2011-07-10 06:14
Was this your inspiration? If not, maybe you can use it as such for future features...
Topic WhirlyGigs By RunnerPack Date 2011-07-09 15:43
Oh. It sounded like a different bug from your description...

BTW, thanks for sharing it; it's really fun to play with.
Topic WhirlyGigs By RunnerPack Date 2011-07-08 03:18
Cool! Try: 18, -13, 23

Another "undocumented feature": The sliders "physically" range from -30 to 30, but you can actually slide them past the ends.
Topic ruby-opengl gem for Windows By RunnerPack Date 2011-06-08 11:42
First of all, yelling at me will not make me want to answer you faster.

Secondly, you didn't really ask me anything, or even provide any new information I can use to help.

Finally, I've already explained I know next to nothing about Ocra. It might be time to ask the Ocra developers, or at least try a forum with a lot of Ocra users, since this has nothing to do with Gosu or the subject of this thread.
Topic Disabling antialiasing for Gosu::Font By RunnerPack Date 2011-05-31 11:13
I like the sound of this entire sub-thread!

Here's a semi-related idea I had:

Add a new method in the "Font#draw" family (Font#draw_each, perhaps) that yields each character's Gosu::Image, x, and y to a block, rather than drawing them. It would allow modifying the position, rotation, color, etc. of each character before drawing it. It could be used for cool typography effects like those used in the dialog boxes in the Paper Mario series of games, among others.
Topic Ruby bindings for Chipmunk 5.3.4 By RunnerPack Date 2011-05-31 10:16
Installs for me on Win XP. Is there any example code out there with which to test it?
Topic Ruby bindings for Chipmunk 5.3.4 By RunnerPack Date 2011-05-21 22:19
That's fine; I'm in no hurry. Just keeping you apprised of the situation ;)
Topic Ruby bindings for Chipmunk 5.3.4 By RunnerPack Date 2011-05-21 19:07
C:\>ruby -v
ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

C:\>gem -v

C:\>gem lis chip

*** LOCAL GEMS ***

chipmunk ( x86-mingw32)

C:\>gem upd
Updating installed gems
Updating chipmunk
ERROR:  While executing gem ... (ArgumentError)
    undefined class/module YAML::PrivateType
Topic ruby-opengl gem for Windows By RunnerPack Date 2011-05-14 17:54
Well, I just tried Ocra (for the first time) and it didn't work, but the error was "no such file to load: gosu," so I don't think it's a problem with the OpenGL gem. Does Ocra work for you with plain gosu apps (which don't use OpenGL)? What is the error you're getting? If it's just a "not found" error like mine, maybe there are Ocra command-line options that would help.
Topic ruby-opengl gem for Windows By RunnerPack Date 2011-04-04 02:24
Excellent! It's actually "ruby-opengl-0.60.1-x86-mswin32-ruby19.gem, but close enough ;) I'm just posting this for clarity, so others don't get confused about what file they need (although, if the maintainers ever do make a "mingw32" version of the gem, this thread will be useless, anyway).

I can't wait to see the cool stuff you make! :D
Topic ruby-opengl gem for Windows By RunnerPack Date 2011-04-02 20:30
I don't know how to repackage as a gem. Maybe you could install the non-working one, then just replace the files. Actually, now that I think of it, maybe I can just replace the files inside the binary gem...

*** EDIT ***

I tried to "manually" create a gem by recreating the internal structure using the new files, but when I try to install it, I get the following error:

$ gem ins ruby-opengl-0.60.1-x86-mingw32-ruby19.gem
ERROR:  While executing gem ... (Zlib::DataError)
    invalid code lengths set

I've tried using 7zip and gzip (from the RubyInstaller devkit) and I get the same error. Help?
Topic Useful tools for game development By RunnerPack Date 2011-04-02 04:50
Maybe the B is for "bargain". :D
Topic Useful tools for game development By RunnerPack Date 2011-04-01 20:55
Wow! I didn't think it was possible to improve on SFXr! :D  The name makes no sense, though :P
Topic ruby-opengl gem for Windows By RunnerPack Date 2011-03-31 22:30
There aren't that many if you use the zipfile, but here it is, anyway. Just unzip to your root Ruby folder, preserving paths.
Attachment: opengl.7z - Precompiled ruby-opengl 0.60.1 gem for win32 RubyInstaller 1.9.2 (922k)
Topic Ruby OpenGl Tutorials By RunnerPack Date 2011-03-31 05:40
So... does this work "out of the box" on OSX? I'm on Win32 and I wasn't sure where to get "/config/boot.rb" so I made one. Other than that and a trivial change to the location of "earth.png" in "lesson01.rb", it seems to be working well. Thanks!
Attachment: boot.rb.txt - Just rename and put in in a "config" folder alongside the others from the repo. (34B)
Topic ruby-opengl gem for Windows By RunnerPack Date 2011-03-31 05:03
I got it! I finally found the definitive, ultimate, complete... (you get the idea ;) method for installing ruby-opengl 0.60.1 in RubyInstaller 1.9.2!

Just read the instructions here: and then get the zip in the next post and read its readme. There are a couple of caveats:

1. it requires the "devkit" that the RubyInstaller people provide. If you don't want to install it (it's not a big deal to install, but I can see why some might not want to) just ask and I'll provide working binaries here.

2. There was some weirdness with Ruby's "config.h" being in the wrong folder on my system. I don't know if I messed it up or what, but if you get an error during gem install about "config.h: no such file" or similar, just copy it from "C:\Ruby\include\ruby-1.9.1\i386-mingw32\ruby\config.h" to "C:\Ruby\include\ruby-1.9.1\ruby\config.h" (adjusting paths as necessary). Note: the "1.9.1" part is not a typo.

Happy Ruby-ing, Gosu-ing, and OpenGL-ing! :D

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill