Page 1 of 2

Irrlicht Extensions on Github

Posted: Sun Apr 22, 2018 4:55 am
by chronologicaldot
I have alot of GUI elements that I created for a specific project but most of them are general purpose, so I decided to upload these to Github. (I also uploaded a modified version of CGUIListBox2 created by tom_gamer since he put it under the same license as Irrlicht.)

https://github.com/chronologicaldot/IrrExtensions

Here's a screenshot from my project showing the GUIGroupingPanel, the GUIMatrixPanel, and the alternate-appearance GUIDropdownSelector.
Image

Re: Irrlicht Extensions on Github

Posted: Mon Apr 23, 2018 10:02 am
by CuteAlien
Ah - grouping panel is nice - I missed that sometimes already. Even rounded corners :-)

Re: Irrlicht Extensions on Github

Posted: Mon Apr 23, 2018 8:23 pm
by chronologicaldot
I forgot when I uploaded it that the GUIMaterialPanel in there incorporates a element called GUIScene. I hadn't included it because I didn't know about the license, but I double-checked and it's unrestricted, so I have now added it.

@cutealien - I like it when my GUI appearance has class. XD For the internal size, the GUI element has a function that returns the optimal client area rectangle that accounts for the radii of the corners. If you use that to size up a container element for the elements inside, using setAlignment( EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT ) will keep everything inside the Grouping Panel. Container GUI elements that I now develop (including an unpublished GUIDualPanel element) either automatically set children or have child elements that you're supposed to add things to rather than directly assigning to the main one. That's just a heads up in case I throw those in there.

Re: Irrlicht Extensions on Github

Posted: Mon Apr 23, 2018 8:53 pm
by devsh
Does IrrExt contain anything not related to GUI?

Re: Irrlicht Extensions on Github

Posted: Tue Apr 24, 2018 4:58 am
by chronologicaldot
@devsh - The original IrrExt ( https://sourceforge.net/p/irrext/code/HEAD/tree/ ) has some other stuff, but most of it is old (and thus may not work with recent versions of Irr) or has been included in the trunk. At the moment, I don't have anything else but GUI stuff in mine, but since that seems to be the biggest area I find lacking in my needs from Irrlicht, that's the stuff I make.

Re: Irrlicht Extensions on Github

Posted: Thu Jul 05, 2018 8:53 am
by Dreadstew
This is awesome! Thank you!

Re: Irrlicht Extensions on Github

Posted: Wed Jun 12, 2019 6:39 pm
by chronologicaldot
I've made some fixes on stuff, particularly GUIFileSelectPanel, which no longer attempts to restore the directory the moment you click "Ok" or "Cancel". That was really silly (and got overlooked for a while) because you couldn't request the selected file path before the directory was changed.

Re: Irrlicht Extensions on Github

Posted: Mon Nov 16, 2020 3:56 pm
by Ovan

Re: Irrlicht Extensions on Github

Posted: Tue Feb 09, 2021 9:51 pm
by chronologicaldot
I have added a GUI Skin based on the one used by Blender. It's "nicer" than the default ones we currently have. (It has rounded edges for elements.)
Here's a sample image of all of the built-in GUI elements:
https://github.com/chronologicaldot/Irr ... enshot.png

Re: Irrlicht Extensions on Github

Posted: Wed Feb 10, 2021 12:34 pm
by CuteAlien
Oh that's nice indeed.

Re: Irrlicht Extensions on Github

Posted: Sun Apr 18, 2021 2:46 pm
by Andrey01
I`m trying to compile my project with GUIScrollPane.cpp file and I get an error from the compiler:

Code: Select all

 
~/balance_wheel/IrrExtensions/gui/GUIScrollPane.cpp: In member function ‘virtual void irr::gui::GUIScrollPane::deserializeAttributes(irr::io::IAttributes*, irr::io::SAttributeReadWriteOptions*)’:
~/balance_wheel/IrrExtensions/gui/GUIScrollPane.cpp:203:103: error: no matching function for call to ‘irr::io::IAttributes::getAttributeAsBool(const char [18], bool)’
  203 |  showHorizontalScrollBar( in->getAttributeAsBool("ShowHorizontalBar", horizontalScrollBar->isVisible()) );
 
irr::io::IAttributes::getAttributeAsBool() has the only argument as it is said in the API official doc: http://irrlicht.sourceforge.net/docu/cl ... e1b8d7c02d but in your that file the two arguments are passed, second of which is boolean.

Re: Irrlicht Extensions on Github

Posted: Sun Apr 18, 2021 3:14 pm
by CuteAlien
Interface has changed between Irrlicht 1.8 and svn trunk version of Irrlicht (there are now default values you can set if the parameter is not found). This uses the new interface already. To compile with Irrlicht 1.8 I guess you have to kick out the bool.

Re: Irrlicht Extensions on Github

Posted: Mon Apr 19, 2021 5:13 pm
by Andrey01
Hmm, strange. GUIScrollPane looks like fully transparent except the scrollbar and editboxes although I did it:

Code: Select all

 
gui::IGUISkin* skin = env->getSkin();
    for (s32 i = 0; i < gui::EGDC_COUNT; i++)
    {
        video::SColor color = skin->getColor((gui::EGUI_DEFAULT_COLOR)i);
        color.setAlpha(255);
        skin->setColor((gui::EGUI_DEFAULT_COLOR)i, color);
    }
 
Image

Re: Irrlicht Extensions on Github

Posted: Tue Apr 20, 2021 10:13 am
by CuteAlien
Don't know the code - but you can always put another static behind it.

Re: Irrlicht Extensions on Github

Posted: Thu Apr 22, 2021 3:10 pm
by Andrey01
I can provide my full code:

Code: Select all

 
void createParametersPanelWindow(gui::IGUIEnvironment* env, u16 params_num)
{
    gui::IGUISkin* skin = env->getSkin();
    for (s32 i = 0; i < gui::EGDC_COUNT; i++)
    {
        video::SColor color = skin->getColor((gui::EGUI_DEFAULT_COLOR)i);
        color.setAlpha(255);
        skin->setColor((gui::EGUI_DEFAULT_COLOR)i, color);
    }
    
    gui::GUIScrollPane* params_pane = new gui::GUIScrollPane(env, env->getRootGUIElement(), core::recti(
        core::vector2di(wnd_size.Width-wnd_size.Width/4, 0),
        core::dimension2di(wnd_size.Width/4, wnd_size.Height)
    ), 1);
    
    params_pane->showVerticalScrollBar(true);
    params_pane->showHorizontalScrollBar(false);
    params_pane->updateAbsolutePosition();
    
    core::recti params_wnd_pos = params_pane->getAbsolutePosition();
    core::dimension2di size = params_wnd_pos.getSize();
    
    gui::IGUIStaticText* gravity_st = env->addStaticText(L"Gravity:", core::recti(
        core::vector2di(size.Width/6, wnd_size.Height/12),
        core::dimension2di(size.Width, wnd_size.Height)
    ), false, false, params_pane, 3);
    
    s32 cur_height = gravity_st->getTextHeight();
    core::recti gravity_st_p = gravity_st->getRelativePosition();
    core::dimension2di gravity_st_s = gravity_st_p.getSize();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(gravity_st->getTextWidth()*3, wnd_size.Height/24)
    ), true, gravity_st, 4);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* original_l_st = env->addStaticText(L"Original Length:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 5);
    
    cur_height += original_l_st->getTextHeight();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(original_l_st->getTextWidth()*2, wnd_size.Height/24)
    ), true, gravity_st, 6);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* mass_st = env->addStaticText(L"Mass:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 7);
    
    cur_height += mass_st->getTextHeight();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(mass_st->getTextWidth()*3, wnd_size.Height/24)
    ), true, gravity_st, 8);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* elasticity_st = env->addStaticText(L"Elasticity:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 9);
    
    cur_height += elasticity_st->getTextHeight();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(elasticity_st->getTextWidth()*3, wnd_size.Height/24)
    ), true, gravity_st, 10);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* air_resist_st = env->addStaticText(L"Air resistance coefficient:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 11);
    
    cur_height += air_resist_st->getTextHeight();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(air_resist_st->getTextWidth()*2, wnd_size.Height/24)
    ), true, gravity_st, 12);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* string_friction_st = env->addStaticText(L"String friction coefficient:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 13);
    
    cur_height += string_friction_st->getTextHeight();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(string_friction_st->getTextWidth()*2, wnd_size.Height/24)
    ), true, gravity_st, 13);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* original_start_ang_st = env->addStaticText(L"Original start angle:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 14);
    
    cur_height += original_start_ang_st->getTextHeight();
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(original_start_ang_st->getTextWidth()*2, wnd_size.Height/24)
    ), true, gravity_st, 15);
    
    cur_height += wnd_size.Height/24 + wnd_size.Height/12;
    gui::IGUIStaticText* pos_st = env->addStaticText(L"Position:", core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(size.Width, wnd_size.Height/24)
    ), false, false, gravity_st, 16);
    
    cur_height += pos_st->getTextHeight();
    
    env->addEditBox(0, core::recti(
        core::vector2di(0, cur_height),
        core::dimension2di(original_start_ang_st->getTextWidth()*2, wnd_size.Height/24)
    ), true, gravity_st, 15);
}