[Solved] Imagebox path - how to set correctly?

Corak55

16-09-2014 10:44:39

Hello!

How do I set a relative path to an image, used in the ItemBox Widget?
Let's assume, the path to image would be "/graphics/stone.png"

Here is the widget code:

<Widget type="ImageBox" skin="ImageBox" position="25 25 140 140" align="Default" layer="2IMGlayer" name="2IMGname">
<Property key="Visible" value="true"/>
<Property key="Enabled" value="true"/>
<Property key="ImageTexture" value="stone.png"/>
<Property key="NeedMouse" value="true"/>
<Property key="NeedKey" value="true"/>
<Property key="InheritsAlpha" value="true"/>
</Widget>


Kind regards,
- Corak

Altren

16-09-2014 15:07:52

I guess you are using MyGUI with OgrePlatform. In this case MyGUI completely relies on OGRE's resource system. As far as I remember to have relative resources paths in Ogre you need to add resource folder with recursive mode:
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(_name, _type, _group, _recursive);And then use path without leading slash.

Corak55

25-10-2014 15:50:46

Thank you, Altren. :) That solved it! :D