Pre-Order the Game!

Desura Digital Distribution

Tuesday, September 13, 2011

New Race Selection and UI Element

Whew, pulled off a marathon of programming. This new Race Selection will pop up when you click on "Race" button in new game setup:



Note the description? That's a new UI element that I just added that allows word wrapping and scrolling. It was a bit tricky to figure out, but I managed to accomplish it! There's a bug where you can scroll down past the end of text, I will look into that later. But for now, it all works! I just need to add descriptions for other races.

All of this was done today, now I'm going to bed! :)

8 comments:

  1. GG, keep going!

    Personally I despise reinventing GUI. I started Zvjezdojedac in C++ with OpenGL. When I've figured that thinking how to design interface for star system took me more than month. I decided to do some GUI design experiments with .NET windows forms. Since whole code required massive refactoring, I abandoned C++ altogether (.cpp and .h aren't exactly refactor friendly). This way I can develop basic idea of the now and put make up later.

    My last job left me with even more traumatic experience of reinventing GUI. We were developing web app in Unity3D engine with C# scripts. Unity3D is primarily engine for 3D stuff (like FPS games), graphics, physics and sound. It has some 2D GUI support but only enough to produce basic menus and show basic information such as player's health and ammo. On the other hand, investors/people with the last word were Mac fans and expected pretty and highly fluid GUI in that app. To make things worse, Unity3D performed much slower in their Mac environments and there were much more sandbox related issues (for example changing cursor image) then on developers' Windows machines. Anyway on one hand the client required broad array of unusual and non-standard GUI components and on the other hand Unity3D engine was simply unable to deliver fully functional combobox.

    To conclude, implementing GUI components is demanding and often ungrateful activity. If you can give that job to your friend, it will help you a lot.

    ReplyDelete
  2. Yeah, reinventing GUI was a pain in the butt. The most painful was the scrollbar/sliders. This multi-line textbox wasn't that hard, because the 2D engine I'm using already have word wrapping feature built in. So the only thing I had to do is to clip the displayed text within a certain drawing area, and be able to move the text so you can scroll.

    Most of the work was setting up the screen, with the radio buttons and delegated functions for cancel and ok button click.

    That multi-line textbox is the last UI element that I needed to add for my game. The game now have all the required items: Buttons, Radio Buttons, Checkboxes, Sliders, Scrollbars, TextBox, Text Input (that handles keyboard input), etc. So from now on, it'll just be bug fixes re-doing the screens, and adding new features :)

    My friend just started a new semester of school, so he don't have much free time to help. So it's basically back to just me.

    ReplyDelete
  3. Now that you mentioned it, how do you setup the screen? Do you hardcode (be it in source code or file loaded at runtime) x, y, width, height for each control or do you have same sort of layout manager?

    If you're not familiar with Java Swing terminology, Swing is almost exclusivity relaying on layout managers to determine position and size of GUI controls. For instance GridLayout arranges components in table-like cells, FlowLayout arranges them one after another either horizontally or vertically, BorderLayout works much like Dock property in .Net windows forms.

    ReplyDelete
  4. Yeah, I'm familiar with Java Swing. But I hardcode everything in the game, their positions and sizes. This is why things are progressing slowly in terms of screen layouts...

    ReplyDelete
  5. fyi, im Wallopingwig :)

    ReplyDelete
  6. another excellent work, keep it up ! :)

    ReplyDelete