Page 4 of 8

Posted: Sat Dec 22, 2007 1:16 pm
by BlindSide
Textures have 2 different methods for obtaining sizes. One obtains the original size of the actual image, and the other contains the (possibly) increased size to the nearest power of 2 if the texture was required to be a power of 2.

Something like getDimensions and getOriginalDimensions ? I think the wording was slightly different though... (Checks API)

Posted: Thu May 15, 2008 1:15 pm
by sp00n
About darker colors - it's true, when i use same texture for skin's window and IGUIImage first looks darker:(
in function

Code: Select all

void CImageGUISkin::drawElementStyle( const SImageGUIElementStyle& elem, const core::rect<s32>& rect, const core::rect<s32>* clip, video::SColor* pcolor  )
we have those lines:

Code: Select all

video::SColor faceColor = getColor(EGDC_3D_FACE);
color.setRed( (u8)(color.getRed() * faceColor.getRed() / 255) );
color.setGreen( (u8)(color.getGreen() * faceColor.getGreen() / 255) );
color.setBlue( (u8)(color.getBlue() * faceColor.getBlue() / 255) );
color.setAlpha( (u8)(color.getAlpha() * faceColor.getAlpha() / 255 ) );
as i see here's a problem, but if we comment this piece we'll lose a transparency. Has somebody any ideas? :)
p.s. when we change to

Code: Select all

video::SColor faceColor = getColor(EGDC_3D_LIGHT);
it works nice for me, but i think there will be a problems not are?

p.p.s. oh, i understood this part of code :) for my goal it needs to make more switch-cases to draw different elements with right colors ... and parts of elements too like window's corners and caption etc :(

Posted: Thu May 29, 2008 1:44 am
by doqkhanh
Is there anybody attempt to fix this error? I am using a Intel Q35 Express with Intel GMA 3100 and my system is well new...

Image

Posted: Thu May 29, 2008 8:32 am
by Klasker
Try downloading it again. I resized two of the textures to have a power-of-two width. I still think it's a bug in Irrlicht, that it uses coordinates after resizing, instead of remembering its original size.

Posted: Thu May 29, 2008 9:15 am
by doqkhanh
Klasker wrote:Try downloading it again. I resized two of the textures to have a power-of-two width. I still think it's a bug in Irrlicht, that it uses coordinates after resizing, instead of remembering its original size.
:shock: That's it!!! Everything is ok now!

Posted: Thu Jul 31, 2008 5:49 pm
by maitrelame2
How do you change the arrows for a list box ?

Thanks for the good work

Very Nice

Posted: Fri Aug 01, 2008 5:17 pm
by kernelpanic
Nice Skin... Remembers me the blender. :D

Posted: Sat Sep 13, 2008 9:45 am
by Is3dpic
Klasker wrote: It's a nice looking skin, and works pretty well with the GUI editor too-
Image
hi,
how do you get this GUI Editor ? please :)
thanks!

Posted: Sat Sep 20, 2008 3:39 pm
by instinct
when i try to implement this in my project, i get these errors. Im using Irrlicht version 1.4, but somehow get these errors:

Code: Select all

Compiling...
UI.cpp
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(10) : error C2039: 'SImageGUISkinConfig' : is not a member of 'irr::gui'
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(10) : error C2065: 'SImageGUISkinConfig' : undeclared identifier
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(10) : error C2146: syntax error : missing ';' before identifier 'guicfg'
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(10) : error C2065: 'guicfg' : undeclared identifier
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(10) : error C3861: 'LoadGUISkinFromFile': identifier not found
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(11) : error C2039: 'CImageGUISkin' : is not a member of 'irr::gui'
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(11) : error C2065: 'CImageGUISkin' : undeclared identifier
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(11) : error C2065: 'skin' : undeclared identifier
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(11) : error C2039: 'CImageGUISkin' : is not a member of 'irr::gui'
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(11) : error C2061: syntax error : identifier 'CImageGUISkin'
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(12) : error C2227: left of '->loadConfig' must point to class/struct/union/generic type
        type is ''unknown-type''
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(18) : error C2227: left of '->setFont' must point to class/struct/union/generic type
        type is ''unknown-type''
..\..\..\..\..\Desktop\GAME\svn\Source\CPP en H files\Game\UI.cpp(21) : error C2227: left of '->drop' must point to class/struct/union/generic type
        type is ''unknown-type''
Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\game\game\Debug\BuildLog.htm"
game - 13 error(s), 0 warning(s)
Seems like it doesnt recognize CImageGUISkin and SImageGUISkinConfig, i have no clue where i should look to solve this so i figured i could ask you here :)

This is my UI class

Code: Select all

#include "UI.h"

// Player players[2];

UI::UI(IrrlichtDevice* device)
{
	this->device = device;
	this->env = device->getGUIEnvironment();

	gui::SImageGUISkinConfig guicfg = LoadGUISkinFromFile(device->getFileSystem(), device->getVideoDriver(), "media/ui/guiskin.cfg");
    gui::CImageGUISkin* skin = new gui::CImageGUISkin(driver, env->getSkin());
    skin->loadConfig(guicfg);

	//IGUISkin* skin = env->getSkin();

	gui::IGUIFont* font = env->getFont("media/ui/fontlucida.png");
    if (font != 0)
		skin->setFont(font, gui::EGDF_DEFAULT);

	env->setSkin(skin);
	skin->drop();
}

// type	getPlayers()
// {
// }

void UI::showHighScores()
{
}

void UI::showPlayerCreationScreen()
{
}

void UI::showMultiPlayerSelectionScreen()
{
}

void UI::showSinglePlayerSelectionScreen()
{
	env->addStaticText(L"Quick SinglePlayer Select", rect<s32>(300,260,400,269), false);
	IGUIListBox* playerlistbox = env->addListBox(rect<s32>(250, 270, 550, 370), 0, 5, true);
	playerlistbox->addItem(L"Yannick");
	playerlistbox->addItem(L"Rutger");
}

void UI::showStartScreen()
{
	device->setWindowCaption(L"user interface van de game");
	IVideoDriver *driver = device->getVideoDriver();
	IGUIEnvironment *env = device->getGUIEnvironment();

	env->addStaticText(L"Onze naamloze game", rect<s32>(50,20,200,40), false);

	env->addButton(rect<s32>(10,110,200,140), 0, 1, L"Single player");
	env->addButton(rect<s32>(10,160,200,190), 0, 2, L"Multi player");
	env->addButton(rect<s32>(10,210,200,240), 0, 3, L"Highscores");
	env->addButton(rect<s32>(10,260,200,290), 0, 4, L"Select player");		

	env->addImage(driver->getTexture("UI testplaatje.jpg"), position2d<int>(300,100));

}

Posted: Sat Sep 20, 2008 7:51 pm
by kingdutch
stodge wrote:
Dances wrote::roll: Maybe you need to turn up the brightness/contrast on your monitor. If you've already done that, then its time to buy a new one.
:roll:
:roll:
Nuf said

Posted: Tue Oct 21, 2008 7:18 pm
by Halan
hey,

i just tried this snipped with 1.4.2 and find it great? What would be needed to get it into irrlicht?

I thought about maybe rewriting the config file to xml and zipping everything to a .skin folder.
But then again i don't know if there is any possiblity to have something like this inside irrlicht.

Instead of containing a FallbackSkin it maybe should inheirt from one of Irrlichts skins and only override certain functions?

greetings,
Halan

Posted: Mon Nov 03, 2008 1:12 pm
by Halan
Hey,

i started working on simplyfing the whole class.

I would like to request spereate draw calls for the background of progress bars and check boxes.
Also the ablility of the xml read to read Colors or Positions.

This is how the config file looks now (imo much cleaner)

Code: Select all

<!-- Config file for the GUI Skin
 Source border is the border width (in pixels) on the texture.
 Dest border is the border width on the screen (also in pixels).
-->

<?xml version="1.0"?>

<guiskin>
	<element name="Button">
		<texture>button.png</texture>
		<srcBorder top="10" left="10" bottom="10" right="10">
		<dstBorder top="10" left="10" bottom="10" right="10">
	</element>

	<element name="ButtonPressed">
		<texture>button.png</texture>
		<srcBorder top="10" left="10" bottom="10" right="10">
		<dstBorder top="10" left="10" bottom="10" right="10">
		<color alpha="255" red="196" green="196" blue="196">
	</element>

	<element name="SunkenPane">
		<texture>sunkenpane.png</texture>
		<srcBorder top="32" left="32" bottom="32" right="32">
		<dstBorder top="10" left="10" bottom="10" right="10">
	</element>

	<element name="Window">
		<texture>windowbg.png</texture>
		<srcBorder top="25" left="10" bottom="10" right="10">
		<dstBorder top="25" left="10" bottom="10" right="10">
	</element>

	<element name="ProgressBar">
		<texture>gauge.png</texture>
		<srcBorder top="16" left="16" bottom="16" right="16">
		<dstBorder top="16" left="16" bottom="16" right="16">
	</element>

	<element name="ProgressBarFilled">
		<texture>gauge.png</texture>
		<srcBorder top="16" left="16" bottom="16" right="16">
		<dstBorder top="16" left="16" bottom="16" right="16">
	</element>
</guiskin>
nice?

greets,
Halan

edit: also I'm wondering if the bug that he fixed with clipRects.h is still there.

Irrlicht 1.5

Posted: Wed Dec 17, 2008 5:52 pm
by Leomond
Hello : )

I just updated to irrlicht 1.5 and got the error related to the abstract class.

Here are the litle changes I made to make it compile:

Add this to the CImageGUISkin.h

Code: Select all

virtual void draw3DTabButton(IGUIElement* element, bool active,
			const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT);

virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
			const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT );
Added this to the CImageGUISkin.cpp

Code: Select all

void CImageGUISkin::draw3DTabButton(IGUIElement* element, bool active,
	const core::rect<s32>& rect, const core::rect<s32>* clip, gui::EGUI_ALIGNMENT alignment)
{
	FallbackSkin->draw3DTabButton(element, active, rect, clip, alignment);
}

void CImageGUISkin::draw3DTabBody(IGUIElement* element, bool border, bool background,
			const core::rect<s32>& rect, const core::rect<s32>* clip, s32 tabHeight, gui::EGUI_ALIGNMENT alignment)
{
	FallbackSkin->draw3DTabBody(element, border, background, rect, clip, tabHeight, alignment);
}
It was simple like that.
I hope this is useful to someone.

Posted: Wed Dec 17, 2008 6:46 pm
by GameDude
That looks pretty cool, I'll have to look into it sometime

Posted: Wed Dec 17, 2008 9:22 pm
by Halan
GameDude wrote:That looks pretty cool, I'll have to look into it sometime
You can also look into my improved version ;)

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=30912