Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / how do i make gui

Author
Message
thekill473
13
Years of Service
User Offline
Joined: 16th Dec 2010
Location: adelaide
Posted: 23rd Dec 2010 08:36
how do i make gui for a 3d game its really confusing me.

www.stormtowergames.webs.com
DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 24th Dec 2010 06:22
You just use sprites, and when the mouse clicks, check to see if it is on top of any of your button sprites. The easy way to do this is to put an invisible sprite where the mouse is and checks for collisions with your buttons.
I'll try making something and get back to you.

I'll get a new signature someday.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 1st Jan 2011 18:04
What I found really helpful is this..

-Create a "Provision GUI Element" function that you can call from anywhere in your program. When you call this it will create a GUI element (button, picture, etc...)

-Create an enable and disable function that will turn a flag on or off for the GUI elements.

-Every loop (refresh) check to see which elements are showing and if the mouse is over an element or clicking on an element.

You must keep in mind child objects (when object a is enabled, also enable object b which is a button that is "on top of" object a). Also keep in mind ordering, so that when you have many objects layered on top of eachother, the program knows which to draw first and which has priority when a mouse click is detected for many objects.

Hope this helps... It takes a bit to setup, but once you have all the functions in place etc... It's pretty much just one function call with about 40 variables to pass to create one GUI element. I'm sure you could simplify this also if you created a tool with a graphical interface and have that export to a text file which your program reads from to create the GUI elements.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 2nd Jan 2011 06:02 Edited at: 2nd Jan 2011 06:05
Quote: "how do i make gui for a 3d game its really confusing me."
That question is equivalent to asking how do i make a game. The GUI is the game and there are a bazillion ways to code one. Understanding the primary/secondary operation behind a GUI, will help you write the code you need.

I've written several GUIs and in my opinion the primary operation is based on Device Input (Mouse) to control a Pointer, Collision Objects (2D/3D Clickable Shape) for Gizmos, and Collision Detection between the Pointer and Gizmos. Display Objects (Sprites, Meshes, Images) are used represent Pointers and Gizmos visually and they are secondary for operation.

So before you go out and tackle a GUI, you have to understand how to manage mouse input, create a clickable areas, and detect collision between the two, and render display objects that represent pointers/gizmos.

Do you have these basics?

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 4th Jan 2011 15:25
Quote: "Create a "Provision GUI Element" function"

What is that? Is there some automated GUI in C++? It would have been nice to know that several months ago when I started making mine.....

The fastest code is the code never written.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 4th Jan 2011 17:59 Edited at: 4th Jan 2011 18:09
Quote: "What is that? Is there some automated GUI in C++? It would have been nice to know that several months ago when I started making mine....."
In that case you could have used Windows or another GUI Lib already available. In my opinion, there's no difference in the principle of moving a character in a game and colliding with a event trigger, verses moving a pointer and colliding with Gizmo/Gadget. Both are User Interfaces and could most likely use the same system if you coded it to do so (Hint:2D/3D GUI). Developing a GUI is very good for refining techniques for developing Game Entity Interactivity. You have not wasted anytime Hawkblood.

Here is the link to MAUI 2.0 Predecessors written with DBPro.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 4th Jan 2011 18:09
Do the Windows Libs work in full screen mode now? The last I researched they didn't....

The fastest code is the code never written.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 5th Jan 2011 11:30 Edited at: 5th Jan 2011 11:53
Quote: "Do the Windows Libs work in full screen mode now? The last I researched they didn't...."
I'm not sure about that, but, I know it doesn't support 3D Gadgets.

thekill473
13
Years of Service
User Offline
Joined: 16th Dec 2010
Location: adelaide
Posted: 24th Jan 2011 09:27
I tried using sprites but it didnt work it just randomly textured one of my objects red.

www.stormtowergames.webs.com
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 24th Jan 2011 13:31
sprites have nothing to do with objects, you are doing something wrong

Login to post a reply

Server time is: 2024-11-19 14:53:54
Your offset time is: 2024-11-19 14:53:54