Page 1 of 1

Can i draw in CEGUI ?

Posted: Wed Aug 06, 2008 09:38
by maitvn
I want to draw a simple graph with CEGUI , Can i draw it ? how to ?

Posted: Thu Aug 07, 2008 09:19
by CrazyEddie
CEGUI has no drawing functions as such.

You could draw to a texture that you subsequently use as the basis of an Imageset and use a widget (StaticImage maybe) to output the content.

CE.

Posted: Fri Aug 08, 2008 02:40
by maitvn
Thank you verymuch !

And i have two Problems :

* I want to load a clock image , this problem can solve by use imageset .

* I want to create a needle of clock can move around Origin . Now , i have no idea for This problem . Can you help me ??

thanks again !

Posted: Fri Aug 08, 2008 12:04
by CrazyEddie
Basically you'll use some other drawing library, or maybe the graphics API directly to perhaps draw a line or polygon into a texture.

You then use that texture as the basis for another Imageset, define an Image for the area that you drew into, and use this Imageset / Image combo as normal. One thing to consider about this is that you only need to do the Imageset creation part once - you can update the content of the underlying texture as you require and the updated content will show next time CEGUI redraws.

Note that in regard to creating the Imageset from the texture, you usually would create a CEGUI::Texture from the underlying engine / API texture for use by the Imageset, however if you're using OpenGL, we are missing a means of doing this directly, so you'd create the CEGUI::Texture first, extract the OpenGL texture name from this and then either the data into it (or use it when setting up a frame buffer, or whatever).

CE.