Ive written a class that takes a texture and animated it between other textures for displaying animated sprites.
And I used to display theese on panel overlayelements and the sprites worked just fine.
However when i tryed to switch to using a 2D rectangle i experienced a very strange error the texture wasnt showing up at all.
However when i add theese 3 lines to the code it works fine on 2d rects as well :
Code: Select all
mOverlayElement = Ogre::OverlayManager::getSingletonPtr()->createOverlayElement("Panel", mName + String("/BombermanSprite/OverlayElem") + unique, false); mOverlay = Ogre::OverlayManager::getSingletonPtr()->create( mName + String("/BombermanSprite/Overlay") + unique ); mOverlayElement->setMaterialName( mMaterial->getName() );
The technique i use to animate the sprites it to manualle create a material with a texture unit state which sets the texture every time the sprite anumation is updated. Im preloading around 50 frames for the sprite and I've tried with other graphics as well and the error is still the same.
Any ideas why something like this couold be happening ?