Page 2 of 2
Posted: Sun Jan 28, 2007 10:00 pm
by sudi
@loonychewy
thanks i didn't know that i always thought irrlicht isn't capable of doing 2d streching...but than i remembered it was rotation which it can't do..lol..my fault.
oh and ITexture provides getOriginalSize () which is the dimension of the loaded image. I had trouble with this too because getSize gives some crazy dimension....
PS: thanks alot by the way

Posted: Sun Jan 28, 2007 10:04 pm
by BlindSide
loonychewy wrote:BlindSide, as ITexture doesn't provide the texture dimension, the only way I'm aware of is to load the texture file as an IImage, and then use IImage::getDimension(). But I'm not so sure what's the ease of use you're trying to achieve. Would you mind elaborating?
Its ok you answered my question, I thought you can somehow get dimensions for "sourceRect" using ITexture but you cannot so its ok...
Woops, looks like it does provide the size
Code: Select all
//! Returns original size of the texture.
/** The texture is usually
scaled, if it was created with an unoptimal size. For example if the size
of the texture file it was loaded from was not a power of two. This returns
the size of the texture, it had before it was scaled. Can be useful
when drawing 2d images on the screen, which should have the exact size
of the original texture. Use ITexture::getSize() if you want to know
the real size it has now stored in the system.
\return Returns the original size of the texture. */
virtual const core::dimension2d<s32>& getOriginalSize() = 0;
//! Returns dimension (=size) of the texture.
/** \return Returns the size of the texture. */
virtual const core::dimension2d<s32>& getSize() = 0;
You can therefore use this in the function and eliminate need for user to enter "sourceRect"
(Usage is ITexture blah; dimension2d<s32> blahsize = blah.getSize(); )
Oh snap Sudi bet me to it

Posted: Mon Jan 29, 2007 2:49 am
by zenaku
I have to give credit to Emil Halim and his TAnimatedSpriteSceneNode. Implementing the IGUISkin interface is easy. Coming up with 2D stretched animation code was more difficult, so I borrowed his, with a few small tweaks.

Since the rendering is done with scene nodes, you can do things like rotation which you cannot do with normal draw2DImage(). The biggest change I made to his original code was to reset the view matrix when drawing the scene node, which is actually a very bad/slow thing to do. The view matrix should be reset only once before the call to guienv->drawAll() instead of inside each scene node render(). doh

Still, it works

Posted: Sun Dec 09, 2007 3:18 pm
by Namek Kural
Just great!
I love you! (You're German right? Wie ist's denn so in Singapur?)
Finally someone did it! Hope it works. I searched something like this for months.
Posted: Thu Dec 13, 2007 2:42 pm
by loonychewy
Namek Kural wrote:
I love you! (You're German right? Wie ist's denn so in Singapur?)
May I ask who is the "you" you are referring to?

Posted: Fri Dec 14, 2007 8:41 pm
by Namek Kural
I meant you!
I've got a question: Did you already try CGUITexturedSkin with irrlicht 1.4?
My debugger says, 'irr::gui::CGUITexturedSkin' couldn't be created because of some abstract members. What I don't understand is that the debugger shows a link to IGUISkin.h but the problem seems to occure in IGUITextureSkin.h?
I don't know what to do
PS: I thought you spoke German because in the example application, there are some German words. But you took the code from the tutorials right?
Posted: Sun Dec 16, 2007 8:23 am
by loonychewy
Unfortunately, I've not been updating it with the Irrlicht 1.4 due to a lack of time ( pLoonyChewy->GenerateExcuses(100) ) There're some API changes to the GUI sub-system in 1.4. If you or anyone else is interested, I can do an update to it
You may already know, there're also a couple of equally good, if not better implementations of textured GUI such as
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=22449. Well done guys!
P.S. Ich bin Singapurer, aber ich lerne jetzt Deutsch

Posted: Sun Dec 16, 2007 10:44 am
by FuzzYspo0N
m interested in a 1.4 fix

Posted: Mon Dec 17, 2007 2:12 pm
by Namek Kural
I'm interested, too
I just made a skin for yours

Why did you make the checkbox-texture so huge? ^^
I tried the one from your link before and neither implementing it nor running the .exe worked correctly but yours did and I think your solution is better

Yours is done much cooler ^^
Maybe someone's interested in my skin: (Just rename it to "guiskin.png")
My Skin
Posted: Fri Dec 21, 2007 7:46 am
by loonychewy
I've just updated it to alpha 0.3, to be compatible with Irrlicht 1.4. Get it from my link in the first post.
Namek Kural:
My checkbox is large cos there's a lot of empty space in the texture

Anyway, you can feel free to alter the xml to match your own texture.
Your texture is nice! Can I suggest some gradient in the textbox region and a shadow at its edges will make it perfect! Or maybe make it icy-blue to differentiate it from the default irrlicht skin?
Posted: Fri Dec 21, 2007 10:08 am
by Namek Kural
Thank you! I'll try it as soon as possible
EDIT: Thanks! Works just fine!!
This should become a part of the irrlicht sdk!
Just one question: The buttons areall textured now but the 3D effect of th original irrlicht gui is still there, what can I do?
One way would be to load a gui file which has no 3d effect but there must be another solution.
Posted: Wed Feb 20, 2008 1:24 pm
by sp00n
nice work
but in your example only text labels on the controls are transparent, not the own controls. Is it a bug or a feature? (c)
Posted: Sun Mar 02, 2008 4:37 am
by loonychewy
Hi sp00n, sorry for the delayed response. Let me just call it unimplemented

The alpha channel in the texture is supported, but dynamically varying the gui's transparency is not yet implemented.
Posted: Tue Mar 18, 2008 1:32 am
by Namek Kural
Hey!
I switched to a MacBook Pro a few days ago and started converting my "big" project to the Mac Platform.
Everything is fine now expect of one thing that unluckily happens to be your code:
void CGUITexturedSkin::setSpriteBank(IGUISpriteBank* bank)
The Error says:
Code: Select all
ld: duplicate symbol irr::gui::CGUITexturedSkin::setSpriteBank(irr::gui::IGUISpriteBank*) in /Users/jonathan/Development/Projects/Star Wars Galaxy 3D/build/Star Wars Galaxy 3D.build/Release/Star Wars Galaxy 3D.build/Objects-normal/i386/CGUITexturedSkin.o and /Users/jonathan/Development/Projects/Star Wars Galaxy 3D/build/Star Wars Galaxy 3D.build/Release/Star Wars Galaxy 3D.build/Objects-normal/i386/main.o
Please, could anyone explain to me what duplicate symbol means?

Posted: Sun Apr 27, 2008 11:38 pm
by loonychewy
I've recently made a minor modification to dynamically change the skin texture alpha accordingly when the skin colour changes.
Because the texture already have some transparent regions, and I only want to change the alpha of those non-transparent regions, I can only do it pixel by pixel, testing it for non-zero alpha on the original texture first, before modifying the corresponding pixel on the skin texture. This may not be the most ideal approach. Anyone have any good suggestions?
Also, only the skin's alpha itself is changed, but not those for button images and so on, because those textures are stored within the UIElements themselves. Is there a good way for me to update their alphas as well?
If anyone's interested, the updated source and .exe is in the original post.
