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.

Work in Progress / PGui - DarkGDK gui

Author
Message
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 7th Jul 2009 23:22 Edited at: 22nd Jul 2009 21:20
Here is a GUI I started working on for one of my games.
It's for DarkGDK and it's called PGui for now...

Beta version further down.


And some of it's features will be:
*Nice and clean look
*Medialess
*Fast thanks to Cloggy's D3DFunc
*Lots of gui components, buttons, checkBoxes, listboxes...
*Movable windows
*Easily customizable color schemes, and shapes of the gui

Will post a demo soon.

Here is a screenshot.
[b]
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 8th Jul 2009 00:14
Very nice! It looks similar to a GUI I designed awhile ago. I've never been a fan of those GUIs that have drop shadows everywhere and make everything look super-glossy. This looks very clean and straightforward. Nice job!

i like orange
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 8th Jul 2009 19:19
Thanks

Here's a demo if someone would like to try it.

Please tell if you find something odd or anything that doesn't feel right.

Attachments

Login to view attachments
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 8th Jul 2009 20:09 Edited at: 8th Jul 2009 20:16
ooh, that looks nice. I'm also a fan of simple guis.

no chance you're gonna wrap this for DBP is there? I only ask because I've been thinking about making a barebones ui system for DBP and this would save me the work... If not, I think I'll take up the challenge myself

Edit: one thing that would definitely be nice is the abiltiy to place the cursor at the beginning or in the middle of your fields. I noticed no matter where you click on the inside of a field, it always places the cursor(or lack of ) at the end. Of course I noticed your message about adding more features and would be surprised if those two things mentioned weren't planned. I think this gui has the best functionality that I've seen. Very fluid. Good job!
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 8th Jul 2009 20:40
The demo was very nice! The only things I noticed that could be improved were:

-the checkbox had no hover (mouse-over) effect.
-the regular edit box didn't allow spaces.

i like orange
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 8th Jul 2009 21:53
No i'm afraid it's going to be DarkGDK only since I don't own DBP.
Yes the cursor will be implemented and also the ability to move it with left and right button and probably also mouse selecting if I can figure that out.

I had intended that only buttons would have a mouse over effect, but I could always make that an option for other components.

Spaces are fixed now for the next version, I had accidentally left out an equal sign so it did only allow chars bigger than 32.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 8th Jul 2009 23:03
Quote: "I had intended that only buttons would have a mouse over effect, but I could always make that an option for other components."


That's fine, the mouse-over thing is more of a preference for me, it's by no means required in a GUI. I just like having mouse-over effects on everything.

i like orange
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 8th Jul 2009 23:13
Now I'm done for today.

Updated demo.
*Some small bug fixes, hopefully no new created
*EditBoxes now have a cursor, moveable by mouse and left/right keys
Now I have to implement some kind of timer for the gui, the cursor moves way to fast with keyboard input and also for the flashing effect for it.

Attachments

Login to view attachments
Brick Break
User Banned
Posted: 8th Jul 2009 23:47
@PaTTE- I know of just the thread for that.

Permanoobs are awesome.
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 9th Jul 2009 00:25
Really nice ^^. Couple suggestions:

1. Resize-able windows?

2. Click-drag to select text? ( Along with holding shift and an arrow key )

PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 11th Jul 2009 14:31
Updates.
*Resizable windows.
*Selectable text in the EditBoxes, with both keyboard and mouse.


Smaller file size now, compiled as Release.

Attachments

Login to view attachments
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 12th Jul 2009 21:16
Added a Progressbar and ListBoxes/GridViews.

New screenshot

Attachments

Login to view attachments
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 12th Jul 2009 23:20
Sweet! Nice improvements

Is this going to be released for free? I'm beginning to be tempted to use it in Project Eres.

Is/will there be support for drawing custom content in a window?

PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 14th Jul 2009 21:03
Thanks

Yes when it's released it will be free.
If by custom content you mean images, yes it will have some kind of image object where you can load an image from disk and place it inside a window.
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 14th Jul 2009 21:44 Edited at: 14th Jul 2009 21:44
Wow. Nice work! I like the style of the GUI, the different modes of operation of the progress bar, and that the windows can be "rolled up".

One comment: the text cursor is hardly visible at all, and moving the text cursor is way too fast. I press the left or right arrow very shortly and the cursor jumps several characters. It would be better to detect when the user releases the key and then move one character.
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 15th Jul 2009 02:15
How about drawing sprites or 3d content within a window?

For example, if I was going to adopt PGui for Project Eres, I'd need a window that can have sprites and other drawing commands like dbCircle() drawn, and dynamically positioned inside the window.

Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Jul 2009 01:33
Looks very good! Looking forward to play with it using GDK

I don't know how the system is setup for now. But it would be awesome to add for example an image within the window. Imagine the image being rendered by a 2nd camera!

Something like:





PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 19th Jul 2009 13:26
Sorry for the lack of updates lately but it's been so nice weather here so I haven't had the motivation to work on this.

Updates:
*Image Object, can load and show images from eg. disk or another camera
*Some bug fixes

Attachments

Login to view attachments
Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Jul 2009 16:57
Yeahs!! thats awesome Exactly what I ment. Great work!

Could you maybe show us some c++ code of how you create the windows using your system?
zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 19th Jul 2009 16:59
This looks great. Will you release it free or will it be commercial?
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 19th Jul 2009 17:44
Thanks.

Yes it will be free when released.

Here's an simple example of how to use it.



As for now to access the components (buttons, editBoxes...) you have to access them via the window.
Drowneath
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 19th Jul 2009 18:20 Edited at: 19th Jul 2009 18:20
Looks nice and easy to use nice work!

When it will be released then?

Because IMO it already covered the most used GUI components
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 19th Jul 2009 20:43
Well it would be nice to release a beta version now for you to test out and then you could report all the bugs you find.

Give me a day or two and I'll have it ready.
I'll clean it up a bit and wrap up some documentation for you about the commands.
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 22nd Jul 2009 21:19
The beta version is now ready for you to experiment with.
Please report all bugs you find.

No documentation yet but I included a very small example.

To be able to use PGui you will have to add a couple of things to your project settings in VS.

1. Under C++/General/Additional Include directories add the PGui "include" folder.

2. Under Linker/General/Additional Library Directories add the PGui "lib" folder

3. Under Linker/Input/Additional Dependencies add PGui.lib(for release) or PGui_d.lib(for debug).

4. I had to add "libcp" to Linker/Input/Ignore Specific Library to get it to work.

Attachments

Login to view attachments
Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 22nd Jul 2009 23:26
Good

It all works, compiles just fine.

I'm currently playing with it. One thing though, How can I change the x and y coordinates from my window? Those properties are private and I couldn't find a function like 'wnd->setPosition(x,y);' or something like that

Other than that, very good and easy
Drowneath
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 23rd Jul 2009 08:00 Edited at: 23rd Jul 2009 13:59
Nice! I'll try it out when I'm home.

Btw, can I have (only) the PTextbox source code? I'm having problem in my simple GUI class for my game when updating the textbox's text. Maybe I can learn from yours? or you can remove the other things from it and just leave the lines that do the draw update? But nevermind if you can't I understand.

Will this be released for free at all even for commercial project when it comes into a stable release? or you'll use other license?
Drowneath
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 23rd Jul 2009 14:46 Edited at: 23rd Jul 2009 14:50
@Turoid: You can simply define your own function in the header files to modify the private members.

I added these lines to PWindow.h (as public members):


Main.cpp:


So that we can reposition the window, or change its foreground and background color, or get the current FG and BG color.
Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 24th Jul 2009 13:15
Ofcourse!

Thanks for the tip!
Drowneath
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 24th Jul 2009 19:35 Edited at: 24th Jul 2009 19:39
I keep getting this linker error:
Quote: "D3Dfunc.lib(D3DFunc.obj) : error LNK2005: "struct IDirect3DDevice9 * g_pD3DDevice" (?g_pD3DDevice@@3PAUIDirect3DDevice9@@A) already defined in terrain.lib(Basic.obj)
Creating library DebugProject.lib and object DebugProject.exp
DebugProject.exe : fatal error LNK1169: one or more multiply defined symbols found"


If I combine PGui with AndrewT's DarkOOP in a project. (DarkOOP: http://forum.thegamecreators.com/?m=forum_view&t=124748&b=22)

Know why?





Yes, I've added D3DFunc include and lib directory to the VC++ Directories setting.
Yes, I've added PGui directories setting correctly. I'm 200% sure.
PaTTE
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location:
Posted: 24th Jul 2009 23:57
I've been a bit busy lately so I haven't had time to check this post.

Nice to see it works on other computers too.

Actually the set window position command exists but it's called drag(int x, int y) from when I was experimenting with window dragging, I will change the name for next version to setPosition().

Yes it will be free, some creds would be nice though if you use it.

As for the textBox source code there isn't much to show it's nowhere near finished, I'll have to add scrolling text up and down for longer texts, but I can show what I got.

By using D3DFunc text automaticaly wraps so you don't have to worry about that.


Draw is called every update loop for the gui, it draws a box and the text inside it.


With these function you can edit or append text in the box.


And for the linker error I'm not sure what causes it.
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 25th Jul 2009 04:13
I keep getting this error:
Quote: "1>LINK : fatal error LNK1104: cannot open file 'D3Dfunc.lib'"

Anyone know why? I did all of these steps:
Quote: "1. Under C++/General/Additional Include directories add the PGui "include" folder.

2. Under Linker/General/Additional Library Directories add the PGui "lib" folder

3. Under Linker/Input/Additional Dependencies add PGui.lib(for release) or PGui_d.lib(for debug).

4. I had to add "libcp" to Linker/Input/Ignore Specific Library to get it to work. "

And I'm trying to run the example project. Thanks for any help!

Use Google first... it's not rocket surgery!
Drowneath
14
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 25th Jul 2009 07:14 Edited at: 26th Jul 2009 20:40
@PaTTe: Sorry, I mean PEditBox I thought TextBox is the control that allows us to type in the box..
Also, is it possible to create an EditBox outside the PWindow?

@heyufool1: Download D3DFunc (DGDK Version)
Extract it somewhere..and then add the directory that contains D3DFunc.lib and D3DFunc.h to your VC++ Directories.

http://www.dbdepot.co.uk/downloads/D3DFuncGDK%20v3.7.1.zip

EDIT: I found some bugs..
1. if I activate an EditBox while the previous EditBox is active, both of them will be activated at the same time..



2.

the code above will override the title bar of its parent window..

3.

doesn't work.

4.

- I clicked the upper-left screen to trigger myWindow
- myWindow showed
- I clicked okButton
- myWindow disappeared
- I clicked the upper-left screen for the 2nd time
- myWindow didn't appear

and.. I dont see BringToFront() function in PWindow..
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 25th Jul 2009 07:29
Thanks Drowneath it works now! Great work PaTTE! Easy to use and works well!

Use Google first... it's not rocket surgery!

Login to post a reply

Server time is: 2024-05-20 01:25:16
Your offset time is: 2024-05-20 01:25:16