OpenGL GUI anyone? Updated on 11/17/05

Started by
206 comments, last by Alpha_ProgDes 17 years, 10 months ago
(I post this, before I forget it [grin])

Bugreport: You can't get the widgets in a Tabbed Panel with getWidgetByCallbackString() (at least labels, haven't tried another widget).

label = (GUILabel*)Mainframe.getWidgetByCallbackString("WidgetInTabbedPanel");

label is always NULL

Advertisement
About the stl string class replacement; I'll do that asap [smile]

Ludi83: Ooops I thought I fixed that bug already (in my nature demo at least).
If you don't wanna re-download the whole thing all over again, just replace the said function by this:

GUIRectangle *GUIPanel::getWidgetByCallbackString(const char *callbackString){  if(!callbackString)    return NULL;  GUIRectangle *element = NULL,               *tPanel  = NULL;  size_t t = 0;  for(t = 0; t < elements.size(); t++)  {    if(elements[t]->getCallbackString() == callbackString)      return elements[t];  }  for(t = 0; t < elements.size(); t++)  {    if(elements[t]->getWidgetType() == PANEL)    if(element = ((GUIPanel*)elements[t])->getWidgetByCallbackString(callbackString))      break;    if(elements[t]->getWidgetType() == TABBED_PANEL)    if(element = ((GUITabbedPanel*)elements[t])->getLowerPanel()->getWidgetByCallbackString(callbackString))      break;  }  return element;}
bump.

Let us know when you get that std::string replacement, I know that I'm eagerly awaiting it :)
this needs to be stickied, and this project is awesome, keep it up
DONT LET THEM DISCRIMINATE! BRING BACK THE BLACK!
I agree. JavaCoolDude, does it allow you to create your own GUI appearance? So like, instead of the yellow border, make it with a white border and make the widgets more squared, or is it hard coded? Do you plan on making it customizable? It's very nice bud, keep it up!
basically everything is customizable, to change the color, you would simply add a color tag to the XML file. here's an old tutorial that is most likely outdated, but explains things well enough.

oh yes, and JavaCoolDude, can you keep me posted on any source updates (and where to find them) so I can keep the sourceforge site up to date?
- relpats_eht
All these changes could be either hardcoded or modified through the XML init files:

instead of the yellow border, make it with a white border

 <BordersColor     x    = "255" y = "255" z =   "255" /> 


or

 <BordersColor     r    = "255" g = "255" b =   "255" /> 


or

 <BordersColor     x    = "1.0" y = "1.0" z =   "1.0" /> 


or

 <BordersColor     r    = "1.0" g = "1.0" b =   "1.0" /> 


Basically any values beyond 255 will be clamped and then divided by 255 to fit the [0-1] floating point range. You can also specify your color values directly between 0.0 and 1.0.


and make the widgets more squared

Set the clip size to zero.
    <Button callbackString = "exit"            clipSize       = "0">      <Text    string  = "EXIT" />    </Button>


Do you plan on making it customizable?
It already is, it's just poorly documented but now I'm more motivated than ever to making it more polished.

It's very nice bud, keep it up!

<3
Alright let me go and implement the standard string thing once and for all [smile]
Yeah bud, trust me, you got millions of supporters I bet, finally a very easy and simple to implement GUI for opengl, lightweight as well. I'll promote you as much as I can.
Howdy [smile]
Ok so I'm done replacing my custom string class with std::string but before I upload anything new I was wondering about sliders' label: in my current implementation, the label lies beneath the sliders which at a point seemed most logical to me, but now I have my doubts. So here's my suggestion:
Scrape off the Label element from the GUISlider class and leave it up to coder to place it anywhere via panels.

Leave it as it is right now :D
Well you pick

This topic is closed to new replies.

Advertisement