New GUI skin [update: new skins, support for 1.5/1.6]

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
grunt
Posts: 96
Joined: Tue Aug 17, 2004 9:14 pm
Contact:

Post by grunt »

I am trying to compile a dll of klaskers gui so i can use pinvoke with it and use it with c# but cant get it to compile:

221 C:\Documents and Settings\mhartwig\Desktop\source\CImageGUISkin.cpp conversion from `const irr::core::dimension2d<irr::u32>' to non-scalar type `irr::core::dimension2d<irr::s32>' requested

is the error i get. any help would be appreciated getting this to compile.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Can you show us some of the code where it is crashing at? But the error explains itself pretty well. You're trying to cast a dimension2d<u32> to dimension2d<s32>. You can fix it yourself, or tell us where it is crashing so we can help.

EDIT: Nevermind, I found it. In CImageGUISkin.cpp at

Code: Select all

void CImageGUISkin::drawElementStyle( const SImageGUIElementStyle& elem, const core::rect<s32>& rect, const core::rect<s32>* clip, video::SColor* pcolor  )
{
    core::rect<s32> srcRect;
    core::rect<s32> dstRect;
    core::dimension2di tsize = elem.Texture->getSize();

The dimension2di needs to be changed to dimension2du. That should clear up that error.
grunt
Posts: 96
Joined: Tue Aug 17, 2004 9:14 pm
Contact:

Post by grunt »

Actually i was able to get it to compile. Seems the version i downloaded in the earlier threads was older and you need the one from the svn to work with irrlicht 1.6 dll.
Mamnarock
Posts: 2
Joined: Mon Nov 09, 2009 11:45 pm

Suport 1.7

Post by Mamnarock »

to use it with irrlicht 1.7

do the following modifications

CImageGUISkin.h
from

Code: Select all

virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
			bool drawTitleBar, video::SColor titleBarColor,
			const core::rect<s32>& rect,
			const core::rect<s32>* clip=0)
to

Code: Select all

virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
			bool drawTitleBar, video::SColor titleBarColor,
			const core::rect<s32>& rect,
			const core::rect<s32>* clip=0,
			core::rect<s32>* checkClientArea=0);
CImageGUISkin.cpp
from

Code: Select all

core::rect<s32> CImageGUISkin::draw3DWindowBackground(IGUIElement* element,
            bool drawTitleBar, video::SColor titleBarColor,
            const core::rect<s32>& rect,
            const core::rect<s32>* clip)
to

Code: Select all

core::rect<s32> CImageGUISkin::draw3DWindowBackground(IGUIElement* element,
            bool drawTitleBar, video::SColor titleBarColor,
            const core::rect<s32>& rect,
            const core::rect<s32>* clip,
			core::rect<s32>* checkClientArea)
this is to avoid the error of virtual call
CiRiuS2
Posts: 14
Joined: Mon Oct 26, 2009 12:14 am
Location: Spain

Post by CiRiuS2 »

Thanks Mamnarock :)
D.Cent
Posts: 18
Joined: Sun May 13, 2007 8:12 pm
Location: Schwieberdingen (Germany)
Contact:

Post by D.Cent »

Any idea how to make the checkbox tick white?

@Mammarock: Thank you very much, that helped a lot!
thespecial1
Posts: 135
Joined: Thu Oct 30, 2008 11:56 am
Location: UK
Contact:

Post by thespecial1 »

thanks for this skin, has properly sorted out the look of my gui interface, easy to edit aswell ;0)
monchito
Posts: 59
Joined: Thu Mar 08, 2007 9:38 pm

Post by monchito »

Help!!
tried with CodeBlocks & irrlicht 1.7 and this is what i got, two errors
located at
gui::CImageGUISkin* skin = new gui::CImageGUISkin(driver, env->getSkin());

Code: Select all

E:\CodeBlockProjects\irrScene\main.cpp|981|error: cannot allocate an object of type `irr::gui::CImageGUISkin'|
because the following virtual functions are abstract:|

E:\irrlicht-1.7.1\include\IGUISkin.h|499|error:  virtual void irr::gui::IGUISkin::draw3DTabButton(irr::gui::IGUIElement*, bool, const irr::core::rect<irr::s32>&, const irr::core::rect<irr::s32>*, irr::gui::EGUI_ALIGNMENT)|

E:\irrlicht-1.7.1\include\IGUISkin.h|512|error:  virtual void irr::gui::IGUISkin::draw3DTabBody(irr::gui::IGUIElement*, bool, bool, const irr::core::rect<irr::s32>&, const irr::core::rect<irr::s32>*, irr::s32, irr::gui::EGUI_ALIGNMENT)|
any idea why this happen?
Thanks in advance
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

The name of the topic suggests that it is compatible with Irrlicht 1.5 or 1.6, while you are using 1.7. Yes, I think that is the most likely reason.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
manik_sheeri
Posts: 53
Joined: Tue May 19, 2009 12:18 am

Some texture is missing

Post by manik_sheeri »

Hi,

I am using this irrext , klasker'sgui for my texture based GUI application.
but I have noticed that in window mode , some of the textures appear missing from the gui elements.(This is usually for the bottom border of the elements).
But everything appears fine in fullscreen mode.

can anybody tell me what could be possible reason behind this?
D.Cent
Posts: 18
Joined: Sun May 13, 2007 8:12 pm
Location: Schwieberdingen (Germany)
Contact:

Post by D.Cent »

Which renderer do you use, manik_sheeri?
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Post by Frank Dodd »

Great job on this GUI module. I've only just taken a look at this. Its working very well and is a very easy way to customize the GUI.

The errors that Monchito referred to some months ago are due to changes in the interface defined in IGUISkin (although they are only thrown by the latest dodgy GCC compiler I believe).

Simply check the function declaration in irrlicht/include/IGUISkin.h, to those that are in CImageGUISkin.h and CImageGUISkin.cpp. There are some new parameters in the functions copy them in so they match and you should be good to go.

At the risk of being renamed Frank "Whats the License" Dodd" ... could you clarify the licensing on this please :D

Edit: Asger has kindly returned my mail and clarified that this can be used under any licensing terms.
madoc
Posts: 32
Joined: Fri Feb 11, 2005 10:43 am

My contribution

Post by madoc »

I've been pokeing a sort psudo project for years on and off teaching myself stuff mostly for fun don't intend anything will ever come of it.
I've been using Klagui for quite awhile with it. FuzzySpoons additions were EXCELLENT but imho stopped 1 step to early.
I never liked that Klagui required code changes to change the skin, so heres what I came up with, I expanded it all a bit.
- Converted it all to an XML 'skin' format (this was technically unnecciary)
- This makes heavy use of a XMLRegistry type class I came up with for load/save of settings.
- Made a skinSystem class thats able to on the fly load/change/apply skins.
- Converted old klagui, fuzzyspoon klagui, and the ones that Christianclavet to my skin format so I could load them.
- Made a quick program to show it off.
I figured I took so much from Klagui/FuzzySpoon I could at least contribute what I came with.

Improvements:
- All colors 'skinable' incl checkboxes, theres two ways to fix the problem where they dont show up under fuzzyspoons, patch irrlicht and fix the fact that checkboxes according the documentation are tired to a certain color but are not. Or the easy way, which I did, override the offending function and fix it.
- Skinable tab control, can be skinned independently of the buttons and stuff, I just have near 0 artistic ability so just setting the tab background and the tab button to the button png from each skin was easiest :)
- Moved all the 'hardcoded' values out of the code and into the xml.
- Built the progress bar into the skinSystem
- Bunch of other stuff
Known issues:
- The xml format is terrible, it uses only attributes, when I wrote that class like 2 years ago my xml knowledge wasnt all that strong.
- Theres an odd white line on the shoulders of the tab control under the fuzzyspoon skin.
- clientrect is broken, I think it has to do with the updates I did to make it work with irrlicht 1.7.1 from an earlier post.


Now is your turn, expand further! (and make more open liscenced skins :) )
All of my mods are available under the 'do whatever the hell you want, I don't care' liscence :)
Remember that all the graphics and a lot of the code belong to previous posters.

Code:
Source and binary included
http://www.mediafire.com/?oz0xiffx23y8ca2
Enjoy!
Image
Image
Image
Treeview control is just something I use to debug stuff in XMLRegistry Class.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

@madoc Whoa that Looks sweet!
Working on game: Marrbles (Currently stopped).
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Woa! nice! Thank for improving this... I could try to make new skins now once I have time. Do we need to patch the engine to use it? If someone is able someday, being able to use alpha from texture would be great. (Certain element would be opaque (buttons) other could be semi-transparent (windows)
Post Reply