Radioactive-Software Radioactive-Software
Forum to discuss Radioactive-Software Products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How did you do your GUI system?
Goto page 1, 2, 3, 4  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Tyler James
Guest





PostPosted: Sat Jan 05, 2008 8:11 pm    Post subject: How did you do your GUI system? Reply with quote

Hi, this is Tyler James, I sent you an e-mail a little bit back about beta testing. I am currently working on a game engine in C++/C# and am having some problems getting GUI in. I have tried using CEGUI, GLO, Allegro, even Windows Forms( Sad ).

I was curious how exactly you go about coding GUI from scratch. Would you consider letting me in on some secrets? Or release a few code snippets demonstarting how it is done?

Greatly appreciated in advanced man.
Back to top
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Sun Jan 06, 2008 1:56 pm    Post subject: Reply with quote

Hey Tyler, well I'm really busy but I'll try to break it down as simply as possible.

You have 2 basic structures that make up the GUI,
- Windows
- Controls

The window structure contains information about the window, it's position, size, associated controls, etc.

The control structure contains code about what type of control it is (button, check box, text box, combo box, list, image, custom, etc.), and it's various states.

You add controls to windows by specifiying the type of control and it's relative position to the window's origin. It's really not that conplicated, are you having trouble with the rendering aspects, or the logic/update aspects of the GUI system? I'll go into much more depth on whatever topic you want me to.

But yea, you just update the windows' logic 30 times a second, and render the windows after rendering all your 3D geometry.

- Danny
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
rappen
Mini-Me


Joined: 22 Apr 2007
Posts: 6633
Location: Spijkenisse, Netherlands

PostPosted: Sun Jan 06, 2008 2:30 pm    Post subject: Reply with quote

Yea what he said Razz
_________________
Rappen Fo'shizzle my nizzle oh fo dizzle Razz

Back to top
View user's profile Send private message AIM Address MSN Messenger
Tyler James
Guest





PostPosted: Tue Jan 08, 2008 9:53 am    Post subject: GUI Reply with quote

I understand how the logic works, I have several methods such as UpdateGUI() that update the GUI controls/classes every tick functions based on deltatime, to esnrue the GUI doesn't lag the renderer.

I am not quite sure how to draw the created GUI control, or even create it. I mean, I can make the class with all the variables and such, but the actual object, like the title bar, buttons, how do you make them?

So yes, it is more of the visual representation of the GUI that I am having trouble with.

THank you for your time and any help.
Back to top
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Tue Jan 08, 2008 11:10 am    Post subject: Reply with quote

Cool. Well what I did was design a 512x512 version of each window style/skin and make it a layered .psd so it's easy to modify. Then I use the RECT structure to grab each part of the reference window and stretch it [if necessary, corners don't need to be stretched].

So you'll draw your background by pulling the 16x16 corners from the refernce image, stretch the 1x16 title bar section based on the width of the window, same with the 16x1 section of the vertical window. For the body of the window you'll just sample any area inside the reference window texture for the background color, and stretch it to the window size.

Also you can fill in the center areas of the reference window texture with each of the control types, & their different states. For the check mark have a un-checked, checked, and 'being checked' state, same for buttons, etc. and just use the RECT structure to grab the parts you're interested in [assuming you're using D3DXSprite to render your windows, but you can write your own RECT system very easily if you use OpenGL ].

Let me know if you get what I mean Very Happy

- Danny
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
Guest






PostPosted: Tue Jan 08, 2008 12:03 pm    Post subject: Reply with quote

I am using the Leadwerks Engine. It is based on OpenGL...could you possible post the code for the RECT structure? Other than that I get what you mean! Thanks!
Back to top
tylerp9p
Forum Regular


Joined: 08 Jan 2008
Posts: 20
Location: Behind you...

PostPosted: Tue Jan 08, 2008 7:09 pm    Post subject: Reply with quote

I think I know how to do this now, thanks Dan, and Rappen...you Dutch clutch.
_________________
C/C++/C# Programmer
VB.NET
LUA
Python
BlitzMax - (STUDYING)
DirectX/OpenGL APIs
Back to top
View user's profile Send private message Send e-mail
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Tue Jan 08, 2008 9:58 pm    Post subject: Reply with quote

RECT is standard windows structure.

Rect.top
Rect.left
REct.right
Rect.bottom
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
Tyler James
Guest





PostPosted: Thu Jan 17, 2008 9:18 am    Post subject: Reply with quote

I got my GUI system going fairly well now. I have draggable panels, skinnable panels, and buttons with text. All of which can be colored dynamically.

It is pretty sweet.
Back to top
rappen
Mini-Me


Joined: 22 Apr 2007
Posts: 6633
Location: Spijkenisse, Netherlands

PostPosted: Thu Jan 17, 2008 12:13 pm    Post subject: Reply with quote

No thanks Razz
_________________
Rappen Fo'shizzle my nizzle oh fo dizzle Razz

Back to top
View user's profile Send private message AIM Address MSN Messenger
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Thu Jan 17, 2008 9:19 pm    Post subject: Reply with quote

Tyler James wrote:
I got my GUI system going fairly well now. I have draggable panels, skinnable panels, and buttons with text. All of which can be colored dynamically.

It is pretty sweet.


Cool, any screens?
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
warlord11030
Moris Family Mafia Don


Joined: 19 May 2007
Posts: 2777

PostPosted: Thu Jan 17, 2008 11:19 pm    Post subject: Reply with quote

pff..

i dont know about anything choo nerds be talkin about in this damn topic..




the fuck is an RECT??
_________________
Ive ran my Family for a long time.. Years! The Moris Family operations are on...
-The Sims Online
-Urban Empires
-Secondlife
-There
-SAMP
www.rl-rpg.nl/forum/index.php
www.radioactive-software.com
Don Moris.
Back to top
View user's profile Send private message
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Thu Jan 17, 2008 11:59 pm    Post subject: Reply with quote

warlord11030 wrote:
pff..

i dont know about anything choo nerds be talkin about in this damn topic..




the fuck is an RECT??


You know when you wake up in the mornign and you pitcha tent, that a 'RECT.

A RECT is a win32 structure that represents a rectangle in 2D space. Instead of storing the 4 absolute coordinates of the rectangle (requiring 8 floating point values, ie 1.0, 2.0, 3.0 to define the region), the RECT structure uses relative values from the top left corner of the rectangle, only requiring 4 floating point values ie: x, y, width, and height to represent a rectangular region.

I USE 'RECTS ALL THE TEIEM!!!11

- Danny
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
rappen
Mini-Me


Joined: 22 Apr 2007
Posts: 6633
Location: Spijkenisse, Netherlands

PostPosted: Fri Jan 18, 2008 10:04 am    Post subject: Reply with quote

dgreen wrote:
warlord11030 wrote:
pff..

i dont know about anything choo nerds be talkin about in this damn topic..




the fuck is an RECT??


You know when you wake up in the mornign and you pitcha tent, that a 'RECT.

A RECT is a win32 structure that represents a rectangle in 2D space. Instead of storing the 4 absolute coordinates of the rectangle (requiring 8 floating point values, ie 1.0, 2.0, 3.0 to define the region), the RECT structure uses relative values from the top left corner of the rectangle, only requiring 4 floating point values ie: x, y, width, and height to represent a rectangular region.

I USE 'RECTS ALL THE TEIEM!!!11

- Danny


ok
_________________
Rappen Fo'shizzle my nizzle oh fo dizzle Razz

Back to top
View user's profile Send private message AIM Address MSN Messenger
Rarusu
Viking


Joined: 22 Nov 2007
Posts: 2316
Location: Norway

PostPosted: Fri Jan 18, 2008 10:38 am    Post subject: Reply with quote

I have a axe. I'm gonna cut something....
rappen, come over'ere.
_________________
''Der Mensch der Erkenntniss muss nicht nur seine Feinde lieben, er muss auch seine Freunde hassen können.''
-Friedrich Nietzsche
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming All times are GMT - 5 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
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


Powered by phpBB © 2001, 2002 phpBB Group