how to create ResourceImageSet by code???

1302769950

20-10-2012 10:16:19

how to create ResourceImageSet by code???
i need by code to create ResoureceImageSet...
please tell me how to create it.....
thanks in advance.

Altren

20-10-2012 17:22:24

Creation through code is not supported, we are going to add such functionality in future versions.
Right now the only way is to create xml in code and load it as resource.

my.name

21-10-2012 12:38:56

trunk 5168

Create ResourceImageSet from code

MyGUI::IndexImage index;
index.name = "MyIndex1";
index.rate = 0;
index.frames.push_back(MyGUI::IntPoint(0, 0));

MyGUI::GroupImage group;
group.name = "MyGroup1";
group.texture = "MyTexture1.png";
group.size = MyGUI::texture_utility::getTextureSize(group.texture, false);
group.indexes.push_back(index);

std::string category = MyGUI::ResourceManager::getInstance().getCategoryName();
MyGUI::ResourceImageSet* imageSet = MyGUI::FactoryManager::getInstance().createObject<MyGUI::ResourceImageSet>(category);
imageSet->setResourceName("ResourceImageSet_Manual1");
imageSet->AddGroupImage(group);

MyGUI::ResourceManager::getInstance().addResource(imageSet);