How to change imageset image dinmically.
Posted: Thu Mar 13, 2008 11:13
Hi all,
I´m trying to change the image of a StaticImage dynamically. The only way I have seen to do this is through a imageset. The imageset has a method defineImage where you insert an image in the set. Well, I have to change this image dynamically because it is a render to texture operation. I want to reuse the CEGUI::Texture and the CEGUI::Imageset for all operations, is this possible? I have this by now:
Any help on this?
If anyone needs any more information let me know please.
HexDump.
I´m trying to change the image of a StaticImage dynamically. The only way I have seen to do this is through a imageset. The imageset has a method defineImage where you insert an image in the set. Well, I have to change this image dynamically because it is a render to texture operation. I want to reuse the CEGUI::Texture and the CEGUI::Imageset for all operations, is this possible? I have this by now:
Code: Select all
//Do next rtt operation
RenderTexture* pTex=m_pSceneBurner->TakeShot();
//Texture regenarated
CEGUI::Texture *cTex = pRenderer->createTexture((CEGUI::utf8*)"RttTex");
//I previously created the imageset this way
static CEGUI::Imageset *imageSet = CEGUI::ImagesetManager::getSingleton().createImageset((CEGUI::utf8*)"RttImageset", cTex);
imageSet->defineImage((CEGUI::utf8*)"RttImage",
CEGUI::Point(0.0f, 0.0f),
CEGUI::Size(cTex->getWidth(), cTex->getHeight()),
CEGUI::Point(0.0f,0.0f));
//So now I want to change dynamically the cTex data to reuse the texture I create before, and this way have the imageset first image change. What I´m trying to do is not recreate texture everytime and not recreate imageset. I want to reuse this ones.
CEGUI::Window* pImage=*m_StaticImages.begin();
pImage->setProperty("Image", CEGUI::PropertyHelper::imageToString(&imageSet->getImage((CEGUI::utf8*)"RttImage")));
Any help on this?
If anyone needs any more information let me know please.
HexDump.