Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 10 posts ] 
    Amy
  Thu Aug 27, 2009 12:42 pm
User avatar
Staff

Big Dumb Guy
Sorry this tutorial is quite basic, see here for a better one: http://code.google.com/p/gosu/wiki/RubyTutorial

Gosu has the following useful classes:

Window
Font
Image
Song
Sample

Window

The window is basically where the game is played. Kinda like what game.exe makes in RMXP.

You create it like so:

Expand to see the code.


Image

To draw an image you use the following:

@image = Gosu::Image.new($window, "imagename", hardborders?)
@image.draw(x, y, z)

Font

Text is drawn just like an image.

@text = Gosu::Font.new($window, "text", height)
@text.draw(x, y, z)

Sound

There are two types of sound:

Song: imagine this as a BGM from RMXP.
Sample: imagine as a SE from RMXP.

@short = Gosu::Sample.new($window, "samplename")
@short.play

@long = Gosu::Song.new($window, "songname")
@long.play


Top Top
Profile      
 

    mawk
  Wed Sep 09, 2009 10:28 pm
User avatar


what sound formats can Gosu play natively? is it limited to wav and mp3, or can it process ogg and/or module files (xm, mod) as well?

_________________
you're free, but in your mind
your freedom's in a bind
░░▒▓▒░░░░▒▓░░░▓▒░░░░▒▓▒░░
░░░░░░▓▓▓▒▓▓▓▒░▒▓▓▓▒▓▓▓░░░░░░
░░░░░░░░░▓▓▓▓▓▓▓▒▓▓▓▓▓▓▓░░░░░░░░░
░░░░░░░░▓▓▓▒▓▓▓▓▓▒▓▓▓░░░░░░░░
░░░░░░░▓▒░░▒▓▒░░▒▓░░░░░░░
ImageImageImage


Top Top
Profile      
 

    Dahrkael
  Wed Sep 09, 2009 10:33 pm
VOC@LOID #01
User avatar
Member


Location: SPain :D
depends in what OS are you running it.
In Windows uses FMOD, in Mac uses OpenAL and in Linux uses SDL_mixer

so check the supported format for your library.

_________________
You prefer 2D
Content Hidden

or 3D?
Content Hidden


Top Top
Profile      
 

    kyonides
  Wed Dec 23, 2009 9:05 pm
Member

You can check this screenshot taken from Gosu team's website.

http://code.google.com/p/gosu/wiki/SupportedAudioFormats

Content Hidden


Top Top
Profile      
 

    Prexus
  Fri Mar 04, 2011 12:40 am
User avatar
Sponsor

Are there any examples of anything made within Gosu?


Top Top
Profile      
 

    BlueScope
  Thu Apr 21, 2011 11:50 am
The Third Man
User avatar



Location: Germany
Ah, totally missed this... I guess I didn't really count on anyone being interested in Gosu anymore at all :p

For examples what's being made, you can check out the Showcase Forums on libgosu.org (official site). Don't expect graphical overflow (as I said in my indie community thread, no other community is picky about graphics before mechanics as RM folks are, and therefore, most of the stuff there is selfmade), but do expect interesting concepts on a every-third-thread-the-least basis.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    rey meustrus
  Thu Apr 21, 2011 8:31 pm
Master of Dark Magic
User avatar
Sponsor

Party Mascot
Hello. Gosu can play .ogg. It's significantly less limited than RMXP/VX in what sound formats it can play. HOWEVER! MIDI is not generally supported. IIRC, it's coming in Win/Linux but not for Mac yet unless someone patches in an interface to Core Audio. Also, Windows uses Audiere now instead of FMOD.

I've been working on an interface from RMXP games to the Gosu engine, preserving the RMXP interface. This could also be used for RMVX; the main thing I'm probably never going to code myself is a rewrite of the Tilemap class (all I would need is a good description though, especially how autotiles work), although sprite wave effects are a close second. Right now I'm waiting for better MIDI support. A bug in Gosu that had affected RTP resources has been fixed, and a new Image#insert method looks promising for trying out ImageMagick instead of Texplay to make text rendering and certain other effects much faster.

_________________
Image


Top Top
Profile      
 

    armornick
  Mon Dec 05, 2011 8:22 pm
Member

Sorry if this is a necro, but I was wondering what everyone thinks of Gosu performance?
i.e. Can Ruby be used for serious (2D) game development?
Also, how much of a difference does it make that the rendering is written in C++?


Top Top
Profile      
 

    Dahrkael
  Mon Dec 05, 2011 9:37 pm
VOC@LOID #01
User avatar
Member


Location: SPain :D
Ruby 1.9.x, especially 1.9.3 is perfectly fine for serious game development.
keeping the rendering part in C++ removes the overhead from the ruby internal operations, and thats a lot since it gets called almost everytime.

_________________
You prefer 2D
Content Hidden

or 3D?
Content Hidden


Top Top
Profile      
 

    BlueScope
  Tue Dec 20, 2011 1:24 pm
The Third Man
User avatar



Location: Germany
Gosu performs especially well on handling images, so if you have a graphics-exhaustive game, you might've found a mate here.
Also, note that there is not only a Ruby-based, but also a C(++)-based version of Gosu that is obviously still better in terms of performance.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


Who is online

Users browsing this forum: No users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group