using RenderableImage

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
thumperj
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Jan 12, 2005 12:06
Location: Austin, TX
Contact:

using RenderableImage

Postby thumperj » 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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: using RenderableImage

Postby CrazyEddie » Sun Feb 13, 2005 20:49

Is the containing Window object using Relative or Absolute metrics? If Relative, then that's your problem - to fix, simply use the getAbsoluteSize() method instead of getSize() when setting the size of the RenderableImage. You probably already thought of this though :?

Your code looks good (you're basically doing the same as what is done in StaticImage), so if it's not the above I'll have to delve into things a little deeper tomorrow.

CE.

User avatar
thumperj
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Jan 12, 2005 12:06
Location: Austin, TX
Contact:

Re: using RenderableImage

Postby thumperj » Sun Feb 13, 2005 21:12

<slapping forehead>DOH!

:oops: That's exactly what it was. Geeesh....

Thanks very much,
Chris


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 7 guests