using RenderableImage
Posted: Sun Feb 13, 2005 20:31
Ok, I'm going a little nutty here....
I want to use RenderableImage instead of Image for some things but am missing something because I can't seem to get the image to appear on screen.
In my constructor of the containing object I have:
Imageset* iset = ImagesetManager::getSingleton().getImageset( ImagesetName );
myImage.setImage( &iset->getImage( StaticImageName ) );
myImage.setPosition( Point( 0, 0 ) );
myImage.setHorzFormatting( RenderableImage::HorzStretched );
myImage.setVertFormatting( RenderableImage::VertStretched );
Then, in the drawSelf() funtion of the containing object I have:
Size sz = getSize();
myImage.setSize( sz );
Rect clipper( getPixelRect() );
Rect absrect(getUnclippedPixelRect());
Vector3 pos( absrect.d_left, absrect.d_top, z );
myImage.draw( pos, clipper );
And nothing shows up. I can simply change this to an Image (with the appropriate code) and it works as I'd expect. Any hints? (No errors in the log, btw, and all numbers look reasonable when inspected.)
Thanks,
Chris
I want to use RenderableImage instead of Image for some things but am missing something because I can't seem to get the image to appear on screen.
In my constructor of the containing object I have:
Imageset* iset = ImagesetManager::getSingleton().getImageset( ImagesetName );
myImage.setImage( &iset->getImage( StaticImageName ) );
myImage.setPosition( Point( 0, 0 ) );
myImage.setHorzFormatting( RenderableImage::HorzStretched );
myImage.setVertFormatting( RenderableImage::VertStretched );
Then, in the drawSelf() funtion of the containing object I have:
Size sz = getSize();
myImage.setSize( sz );
Rect clipper( getPixelRect() );
Rect absrect(getUnclippedPixelRect());
Vector3 pos( absrect.d_left, absrect.d_top, z );
myImage.draw( pos, clipper );
And nothing shows up. I can simply change this to an Image (with the appropriate code) and it works as I'd expect. Any hints? (No errors in the log, btw, and all numbers look reasonable when inspected.)
Thanks,
Chris