Load layout from memory

Zaoshi

13-11-2012 15:25:31

Hello,

There's a way to load layout from file using MyGUI::LayoutManager::getInstance().loadLayout(...); or create GUI manually by ...->createWidget<...>(...);.
However, I'm planning to use datafiles, so layout file will exist only in the memory and I failed to find any function that can load layout from memory pointer. Does anyone know if this is even possible?
Using manual way of GUI creation definitely fixes this issue, but it's very hard to edit it, so I'd prefer not to use this way.

Thank you in advance.

Altren

13-11-2012 17:58:12

Whenever you load layout from file for the first time it is kept in memory, so next time you will not load it from file again, but from preloaded and parsed resource.
If you don't have file at all you can create resource from stream, and then it into Ogre's resources, and then MyGUI::OgreDataManager will use it.
Also you can look through OgreDataManager and add required functionality there - loading from memory instead of Ogre's resources. I guess this is what you need, since you have custom source of data.