|
|
|
|
|
View previous topic - View next topic |
Author |
Message |
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Wed Sep 12, 2007 3:02 am Post subject: Creating guis, in game menus, etc. |
[quote] |
|
I'm looking to make my own gui. I've never done this before. I'm looking to make in game menus for character trading, looking and identifying items (after right clicking), and the overall interface of the game.
Now, I've always been a programmer, but I've never tried this before. Should I just create images in adobe, or is there a better way to do this?
I'm thinking of making translucent windows, etc. Different color schemes. Would I just blit that to the screen as part of my drawing phase? I'm looking to make a 3D RPG.
Thanks for all input.
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Wed Sep 12, 2007 12:47 pm Post subject: |
[quote] |
|
I once implemented my own windowing system to be used inside the game.
It took a lot of time and it had a lot of bugs. But ultimately this gave perfect control over all details, from drawing them onscreen to handling of UI events.
Graphic-wise I used a collection of window elements, like borders, title bars, buttons and similar which were then drawn to assemble the windows. Those were stored as PNG images.
I assume this was the most complex approach to implementing an UI. It even had it's own font renderer :/
Currently I'm using a library which offers just that, at least this time I have not to code it by myself. But now I'm stuck with what the library offers, which makes my UIs appear more like a business application than a game currently. (Using Java Swing).
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Wed Sep 12, 2007 2:35 pm Post subject: |
[quote] |
|
I know what you mean. Java Swing is nasty.
I'm currently using C++, so unless I want to use some sort of windows generated gui, I'm going to have to make my own. How did you create your own GUI the first time around? Is there any advice you can give me?
I think for the time being I might stick with the windows for now, just so it doesn't hold up my program.
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Wed Sep 12, 2007 2:52 pm Post subject: |
[quote] |
|
Well, working as a Java developer and that time using C++ for my hobby projects, I felt inspired by the structure of the Java AWT libraries. Basically I reimplemented what I learned from Java AWT in C++, at least what concerns the architecture.
Basically I created a class similar to Java Graphics, to draw onto. This was based on SDL, but I had an X-Windows implementation for that a while, too.
The UI component library was small, basically one window class, containers to group components, and a handful basic components like labels and buttons. Each component was able to draw itself onto such a graphics object. So basically on a repaint the windows were drawn from bottom to top, each window recursively requested its components to paint themselves. Overall it worked rather nicely, the devilish parts were event handling (which window/component gets key events? Does a window/component get mouse events if the mouse is not over the window/component) and memory management if components were deleted (e.g. some event triggered to delete a window or only part of the components inside which triggered a repaint, which then accessed components that were just deleted. Solveable, but icky if you are not careful enough).
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Wed Sep 12, 2007 5:08 pm Post subject: |
[quote] |
|
SDL rocks. It's so easy to work with. I'm debating whether or not to use SDL in my project, or just go with Windows.
That's another thing, portability. I have so many books on directX, but I've never used Open GL before. I wonder if I should check it out and see if I can go cross platform.
|
|
Back to top |
|
|
|
Page 1 of 1 |
All times are GMT
|
|
|
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 You cannot vote in polls in this forum
|
|
|