Page 1 of 1

Curve Edit Widget

Posted: Wed Oct 06, 2004 09:05
by psyclonist
Hi again,

right now I try to find a nice way to create a curve editor widget.

The basic operations I need to do on the drawing area are limited to drawing lines of differing colour.

CrazyEddie, can you give me a hint where to look for an easy solution? I'm still not casual enough with CEGUI ;)

I could use an CEGUI::Texture and render manually into it (and copying the buffer) but I don't see how bit-depth etc can be selected generically. Or I could render degenerated quads, or ...

Any ideas?

-psy

Curve Edit Widget

Posted: Wed Oct 06, 2004 09:20
by CrazyEddie
Hmmmm. I presume this is with Ogre?

Probably the best way is to render what you need to a texture. You should be able to use any Ogre::Texture you like, and use that as the basis for a CEGUI::Texture (there are new methods for creating a CEGUI::Texture from an existing Ogre::Texture). You then use this CEGUI::Texture as the basis for an Imageset, which you define an image on and use that Image to place whatever you drew into the Ogre::Texture into a UI element.

I'm aware that what I just described sounds a bit long winded; but it's not really all that bad when you do it (pjcast uses as similar technique for the Ogg Theora player).

If you need control points (which I assume you will), you'll need to code these as a new widget type. Certainly possible, though maybe not easy as a first widget :)

I'm not sure if I was much help or not :lol:

CE.

Curve Edit Widget

Posted: Wed Oct 06, 2004 17:02
by psyclonist
Longwinded, yes! But still clarifying ;)

Regarding the control points... I think, there should be a way to do this without coding a new widget because I can easily convert from screen space into image space into curve space, and back again. It may not be that elegant, though.

-psy

Curve Edit Widget

Posted: Wed Oct 06, 2004 18:18
by CrazyEddie
Longwinded, yes! But still clarifying ;)

:shock:

Okay, I admit it; I tend to ramble on a little :D

CE.

Curve Edit Widget

Posted: Wed Oct 06, 2004 22:21
by psyclonist
Don't worry :lol: I'm grateful for your help!

-psy