Illidanz
09-02-2013 22:04:51
Hello,
I want to create an ImageBox with stretch alignment, but I don't want the texture to be distorted by Ogre's linear filtering.
I have seen the FilterNoneSkin but I don't understand how to use it with ImageBox, can you provide an example?
Thanks in advance
my.name
13-02-2013 06:08:17
Using custom skin for ImageBox
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Resource" version="1.1">
<Resource type="ResourceSkin" name="ImageBoxFilterNone" size="16 16">
<BasisSkin type="FilterNone" offset="0 0 16 16"/>
</Resource>
</MyGUI>
Illidanz
13-02-2013 06:26:44
Thanks for the answer my.name,
I tried that (I put the code in MyGUI_CommonSkins.xml under the normal ImageBox one) and I changed my ImageBox to look like this
<Widget type="ImageBox" skin="ImageBoxFilterNone" position="0 0 400 230" align="Stretch" name="textureClient">
The file gets loaded correctly and there's no error/warning in the log.
However, when I actually use it I can see that ogre loads the texture, but the widget is empty and the image doesn't show up.
Any idea? I'm using the latest svn rev (5179)
my.name
15-02-2013 15:28:31
std::string subWidgetCategory = MyGUI::SubWidgetManager::getInstance().getCategoryName();
MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::FilterNone>(subWidgetCategory);
Try to register it.
Illidanz
15-02-2013 16:06:02
Thanks a lot, it works now
Although I had to add the MyGUI_FilterNoneSkin.h and .cpp in my project since they are in the EditorFramework, not in MyGUIEngine, but it works so it's ok