Curve Edit Widget

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
psyclonist
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 12, 2005 12:06
Contact:

Curve Edit Widget

Postby psyclonist » Wed Oct 06, 2004 09:05

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

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

Curve Edit Widget

Postby CrazyEddie » Wed Oct 06, 2004 09:20

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.

User avatar
psyclonist
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 12, 2005 12:06
Contact:

Curve Edit Widget

Postby psyclonist » Wed Oct 06, 2004 17:02

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

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

Curve Edit Widget

Postby CrazyEddie » Wed Oct 06, 2004 18:18

Longwinded, yes! But still clarifying ;)

:shock:

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

CE.

User avatar
psyclonist
Just popping in
Just popping in
Posts: 9
Joined: Wed Jan 12, 2005 12:06
Contact:

Curve Edit Widget

Postby psyclonist » Wed Oct 06, 2004 22:21

Don't worry :lol: I'm grateful for your help!

-psy


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests