CSQC GUI for DarkPlaces
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
CSQC GUI for DarkPlaces
Hi!
I made a structured GUI for DarkPlaces, that can handle windows/buttons/editfields/ect...
All objects are placed in a tree structure, so it can handle child objects (like a button in the window) and you can add custom events to all object (at onMousePressed/Released).
I tried to make the whole "GUI object" creation/customization simple as I can. For example this creates a window:
void() createWindow = {
entity window, button;
window = createGuiObj(world/*this is the parent*/,"window1"/*this is the ID*/ );
window.text = "Your First Window"; //The title
window.position = '10 10 0';
window.size = '120 80 0 ';
window.onMousePressed = dragMove_Start;
window.onMouseReleased = dragMove_Finish;
//it's now "draggable"... Yeah
button = createGuiObj(window, "Button1"); //spawns Button1 as the child of Window
button.text = "BuTtOn";
button.position = '10 10 0'; //Relative to the window...
button.size = '50 20 0';
button.onMouseReleased = yourFunctionThatDoWhatYouWant;
}
The whole thing is available to download with source at:
http://gprograms.co.cc/
There's also a video:
http://www.youtube.com/watch?v=RVgPOkGL0u0
I think this stuff can be useful for somebody who want handle a little bit more advanced GUI, but send me a feedback.
Btw, it's in an early stage, it's not well documented, and far from complete...
(and sorry for the bad english)
I made a structured GUI for DarkPlaces, that can handle windows/buttons/editfields/ect...
All objects are placed in a tree structure, so it can handle child objects (like a button in the window) and you can add custom events to all object (at onMousePressed/Released).
I tried to make the whole "GUI object" creation/customization simple as I can. For example this creates a window:
void() createWindow = {
entity window, button;
window = createGuiObj(world/*this is the parent*/,"window1"/*this is the ID*/ );
window.text = "Your First Window"; //The title
window.position = '10 10 0';
window.size = '120 80 0 ';
window.onMousePressed = dragMove_Start;
window.onMouseReleased = dragMove_Finish;
//it's now "draggable"... Yeah
button = createGuiObj(window, "Button1"); //spawns Button1 as the child of Window
button.text = "BuTtOn";
button.position = '10 10 0'; //Relative to the window...
button.size = '50 20 0';
button.onMouseReleased = yourFunctionThatDoWhatYouWant;
}
The whole thing is available to download with source at:
http://gprograms.co.cc/
There's also a video:
http://www.youtube.com/watch?v=RVgPOkGL0u0
I think this stuff can be useful for somebody who want handle a little bit more advanced GUI, but send me a feedback.
Btw, it's in an early stage, it's not well documented, and far from complete...
(and sorry for the bad english)
- metalbeast
- Posts: 4
- Joined: Tue Jul 06, 2010 7:27 am
Looks complicated. I don't see the point of customizing the HUD. Design a simple, aesthetically pleasing HUD; like the hud from borderlands, but a wee bit smaller, and leave it be.
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
-

dreadlorde - Posts: 268
- Joined: Tue Nov 24, 2009 2:20 am
holy crap you're making a working gui system for the people how is this even possible this is something we've been waiting years for!
by the way what license is this in? if you make it a public domain one it might actually be adopted by modders here as well as the gpl folk. I ask because it's not specified
by the way what license is this in? if you make it a public domain one it might actually be adopted by modders here as well as the gpl folk. I ask because it's not specified
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Downsider: I read that rendering to world polygons is impossible via CSQC... If it's correct, than I can't make "Doom3-style" screens...
http://qexpo.tastyspleen.net/booth.php?id=165&page=308
Julius: I'm not working on Xonotic. Just for fun
dreadlorde: You make a custom HUD with it. I don't played Borderlands yet, but it's possible to make a custom HUD. There is a GUI flag "GUIFLG_ALWAYSDRAW" witch means the object is always rendered, even the input type is switched back to the game, not the GUI. Look at the video (the HP bar). It's possible to do it with all stats like ammo, armor, etc...
Julius: The same way (with GUIFLG_ALWAYSDRAW) it's possible to create an object wich can't be so easily switched off, like an alert window.
For example, the ssqc prints to the client "Alertwindow I will kick you!\n", and in CSQC you can create an alert window in CSQC_Parse_Print with GUIFLG_ALWAYSDRAWN.
I think it can be implemented to MenuQC, but the input is quite different. I can't figure out how can MenuQC handle released keys or mouse buttons
leileilol:
From now it's in LGPL license. I hope it will helps a lot for other modders. I think QC still rocks, just take a look at Twig Physics Lib.
BTW i updated the stuff... Now it fades in and out on createing and destroying elements...
http://gprograms.co.cc/project/159/csqcgui
Now, I'm working on an edit field, witch can contain a multi-line text, and more advanced string handling in the edit/password fields .
And Thanks for the feedbacks!
http://qexpo.tastyspleen.net/booth.php?id=165&page=308
Julius: I'm not working on Xonotic. Just for fun
dreadlorde: You make a custom HUD with it. I don't played Borderlands yet, but it's possible to make a custom HUD. There is a GUI flag "GUIFLG_ALWAYSDRAW" witch means the object is always rendered, even the input type is switched back to the game, not the GUI. Look at the video (the HP bar). It's possible to do it with all stats like ammo, armor, etc...
Julius: The same way (with GUIFLG_ALWAYSDRAW) it's possible to create an object wich can't be so easily switched off, like an alert window.
For example, the ssqc prints to the client "Alertwindow I will kick you!\n", and in CSQC you can create an alert window in CSQC_Parse_Print with GUIFLG_ALWAYSDRAWN.
I think it can be implemented to MenuQC, but the input is quite different. I can't figure out how can MenuQC handle released keys or mouse buttons
leileilol:
From now it's in LGPL license. I hope it will helps a lot for other modders. I think QC still rocks, just take a look at Twig Physics Lib.
BTW i updated the stuff... Now it fades in and out on createing and destroying elements...
http://gprograms.co.cc/project/159/csqcgui
Now, I'm working on an edit field, witch can contain a multi-line text, and more advanced string handling in the edit/password fields .
And Thanks for the feedbacks!
- metalbeast
- Posts: 4
- Joined: Tue Jul 06, 2010 7:27 am
While you can't currently render to world polygons right now, what you can do is render polygons that are visible in the world just like world polys are.
Render to texture would be nice though.
Render to texture would be nice though.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
