GUI System

Discussion in 'Game Development (Technical)' started by datxcod, Feb 22, 2006.

  1. datxcod

    Original Member

    Joined:
    Dec 16, 2005
    Messages:
    98
    Likes Received:
    0
    Hello

    I'm developing the most enjoyable part of my game : GUI :mad: . I was wondering if you guys developed your own GUI system for your games or used a ready made GUI lib.
    I was gonna start making the GUI but it seemed like too much trouble since there are some nice GUI libs out there besides I would need a couple of weeks to come up with a decent system. So which one would you recommend ?

    Cheers
     
  2. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    I started a thread on this a while back, if you do a search you should be able to find it pretty easily.

    Short story is that I ended up not using any gui libs because they didn't save me much time at all (best case) and/or were horribly broken (worst case).

    I ended up going with a hybrid approach of using xml files to define screens and Lua scripts to define widget behavior. Didn't take as long as I thought and was kinda fun to write.
     
  3. Chozabu

    Original Member

    Joined:
    Nov 30, 2005
    Messages:
    30
    Likes Received:
    0
    ive heard many good things about CEGUI
    currently, only having simple needs, im using xml files for locations and names of buttons/pics
     
  4. svero

    Moderator Original Member Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    3,392
    Likes Received:
    6
    I guess it depends a bit on the kind of game you're writing. A strategy game might have a lot of fancy dialogs and sliders and so on and therefor benefit from a fully fleshed out gui. For my part I just have a basic dialog and button class and that gets me through about 95% of the gui stuff i need to do.
     
  5. Sharpfish

    Original Member

    Joined:
    Feb 25, 2005
    Messages:
    1,309
    Likes Received:
    0
    I made my own class that has animation (movement) bounciness on animation end (squish/squash) a variety of mouse over effects (image swap, bounce swap, colour swap, scale up/down etc). It was relatively simple to do once I had the underlying 2D drawing code in place (which I also use in my bitmap font class) which is just a vertex buffer (D3D) and a quad with an alpha blended texture. I didn't feel the need to go for a 3rd party gui-lib because they are usually more general purpose and I wanted mine to suit the games I had in mind rather than your typical rts or whatever that may need more complicated stuff.

    As for setup it has a number of states in an guiAnim function that sets the elements animation and purpose and what have you, best bit was a "wait" state that you send (by reference) another instance of the class and it won't animate until that one is finished. All rudimentary stuff but looks ok and i'm pleased with it. Good thing about it being my own code is that I can/will optimise/expand as time goes on to fit all cases.

    To sum up: if you have access to general (resolution independent) 2D drawing functions then it's fairly easy to set up your own solution and you will learn/know more about it's workings come expansion time.

    If you don't have time though (but have time to learn another lib) then go for a third party one - if the results are the same it really doesn't matter.
     
  6. electronicStar

    Original Member

    Joined:
    Feb 28, 2005
    Messages:
    2,068
    Likes Received:
    0
    Making your own GUI system is not so difficult and it might actually save you some time instead of using an external library.
    The only problem is that you need to have a bit of experience, i.e. having worked with gui libs before, and know what are the things necessaries and how to do them right. And yes it can be a bit tedious when starting from scratch.
    If it's your first attempt, I suggest using a third party GUI lib until you are comfortable enough so that you can write your own.
    It also depends on the type of game, it's easier to write a gui lib for a fullscreen game with simple window interactions(in this case you should really write your own lib), but if you are develloping a strategy game using the Windows windows then it becomes complex.
     
  7. mot

    mot
    Indie Author

    Joined:
    Oct 21, 2004
    Messages:
    439
    Likes Received:
    0
    You might want to check out IMGUI. Search for it here or on Google.
     
  8. datxcod

    Original Member

    Joined:
    Dec 16, 2005
    Messages:
    98
    Likes Received:
    0
    Thanks

    Thanks folks, I appreciate all your answers.

    I checked your recommendations and I think it would be troublesome to try to adapt a full fledged third party lib to my project (I already took a look at some third party GUIs)

    I decided I should roll my own little GUI system, nothing too complex.

    Thanks again everyone.
     
  9. Rubs

    Original Member

    Joined:
    Dec 16, 2005
    Messages:
    115
    Likes Received:
    0
    I'm using PopCap's framework for my game (you can find it at http://developer.popcap.com). It's GUI system is not veeeery advanced, but it's fairy enough for casual games.
     
  10. NuriumGames

    Original Member

    Joined:
    Aug 6, 2004
    Messages:
    201
    Likes Received:
    0
  11. James C. Smith

    Moderator Original Member

    Joined:
    Aug 21, 2004
    Messages:
    1,768
    Likes Received:
    0
    Here is a link to a related topic where I posted an answer: [thread=3483]Doyou guys use any GUI library ? or do u hardcode it urself ?[/thread]
     
  12. James C. Smith

    Moderator Original Member

    Joined:
    Aug 21, 2004
    Messages:
    1,768
    Likes Received:
    0
    I thought there was another discussion here but I can’t find it. I though I mentioned before that in some games I have worked on the Level Editor was used to make GUIs. Wik & the Fable of Souls and the new Mosaic game that will be released this week have their GUIs contrasted in the level editor and have the full power of the game engines scripting system available in GUI elements. It makes it nice to have access to thinks like Particle Generators in your menus. If you have a good visual tool for editing levels, and it is flexible enough, it can make a lot of sense to use it for making GUIs.
     
  13. vjvj

    Indie Author

    Joined:
    Sep 25, 2004
    Messages:
    1,732
    Likes Received:
    0
    There was... It was a thread I started a while back. I mentioned it in my post above but was too lazy to search for it ;)

    Anyway, I dug it up, here it is:

    http://forums.indiegamer.com/showthread.php?t=4434&highlight=gui

    The thread also has some of my opinions on CEGUI and why I didn't use it.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer