curved window

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
Sachin
Just popping in
Just popping in
Posts: 20
Joined: Wed Jul 06, 2005 09:42

curved window

Postby Sachin » Fri Jul 15, 2005 10:38

Hi

Is it possible to create a curved window using cegui. i know it can be achieved thru the imageset file by making some portions of the window alpha blended. but the catch in this approach is that the window underneath our (so called) curved window doesn't get mouse messages when we click on the aplha blended portion. So although the window is visually curved but the window underneath it is not receiving the mouse msgs, wherever it is overlapped by the bounding square box of the curved window.

Any bright ideas?

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

Re: curved window

Postby CrazyEddie » Fri Jul 15, 2005 13:34

This is not possible within the current system. Adding this ability would likely require a major rethink of the core system, so is probably not likely to happen any time soon.

User avatar
J_A_X
Quite a regular
Quite a regular
Posts: 72
Joined: Wed Jun 29, 2005 13:18
Contact:

Re: curved window

Postby J_A_X » Fri Jul 15, 2005 14:35

do you mean curved corners or a curved side of a window?

User avatar
Sachin
Just popping in
Just popping in
Posts: 20
Joined: Wed Jul 06, 2005 09:42

Re: curved window

Postby Sachin » Tue Jul 19, 2005 07:13

I mean the window can be of any shape...like the window may be of circular shape & there may even be holes inside the window.

User avatar
J_A_X
Quite a regular
Quite a regular
Posts: 72
Joined: Wed Jun 29, 2005 13:18
Contact:

Re: curved window

Postby J_A_X » Tue Jul 19, 2005 13:30

yeah...that's not possible unless you do some major recoding on the GUI part. The WinAPI has skinning options to make your window which ever shape or form you want.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: curved window

Postby lindquist » Tue Jul 19, 2005 13:43

The thing is that a window area in CEGUI is defined by a rect.
Not a list of vertices defining the shape.

Don't expect this to change!

User avatar
Acrion
Just popping in
Just popping in
Posts: 18
Joined: Tue Jun 28, 2005 18:45
Location: Maine, USA
Contact:

Re: curved window

Postby Acrion » Tue Jul 19, 2005 15:59

Is there any thoughts into creating a region system similar to Windows API HRGN?

It is relatively simple to implement into the core with PointInRgn() in Windows but does anyone know of C++ API to achieve this efficiently under any OS?
[font=Verdana][size=xx-small]"It's not hard to stand out when the general level of competence is so low" -EMH[/size][/font]
namik@flashmail.com

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: curved window

Postby lindquist » Tue Jul 19, 2005 16:02

This is not planned at all as focus is currently on the upcoming Falagard skinning system which by the way is going to be extremely cool...

But I'm we could write our own region/point intersection routines that were portable!

User avatar
Sachin
Just popping in
Just popping in
Posts: 20
Joined: Wed Jul 06, 2005 09:42

Re: curved window

Postby Sachin » Thu Jul 21, 2005 10:35

wen is that falagard skin system going to be released?. can u kindly also tell howz it going to be kool...i mean how will it improve the currently existing system?

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

Re: curved window

Postby CrazyEddie » Fri Jul 22, 2005 12:07

The "Falagard" skinning system will debut in the 0.4.0 release, though no release date for this has been discussed.

The reason that "Falagard" is greatly anticipated by some users is because it enables an exremely flexible way of customising the way that widgets are configured and skinned with imagery. Currently, if you want to do anything too different, you have to edit the C++ code or code your own 'look' module, the "Falagard" system enables most areas of the look and feel of a widget to be specified via a XML file.

Example: Something simple like wanting the scrollbar on the left of a listbox instead of the right, to do this pre-falagard would require you to edit C++ code, with falagard you can just specify where you want the scrollbar in the XML (though this example doesn't really even scratch the surface of what's possible).

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: curved window

Postby gcarlton » Thu Jul 28, 2005 01:53

Isn't this fairly easy? If you already have a window with the appropriate alpha'd texture, you just need to decide when the clicks are inside the area.

There may be a virtual function already to do this. Essentially you just need cegui to ask the window "am I clicked". If the click is within the outer bounding box, then cegui can query the window class itself. Then your special derived class can do one of:
1.) Test the position against a circular shape
2.) Test against some polygon
3.) Test against the texture's alpha value

Ok, this is not exactly easy (I'm not even sure if this virtual function currently exists), but it doesn't seem all that hard. Once its done (particuarly if you went with 3), you can go to town with all sorts of strange curvy shapes.

You could even have textures that morphed over time, whatever.

Geoff

User avatar
J_A_X
Quite a regular
Quite a regular
Posts: 72
Joined: Wed Jun 29, 2005 13:18
Contact:

Re: curved window

Postby J_A_X » Thu Jul 28, 2005 13:18

Have you ever seen the CEGUI coding? You would practically have to remake the whole engine from scratch because of this.

If its that easy, why not do it yourself? Maybe you'll learn a few things...

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

Re: curved window

Postby CrazyEddie » Thu Jul 28, 2005 18:38

Geoff has been using CEGUI for quite a while, has submitted a few patches (some accepted, some rejected ;) ), and made some great suggestions over that time - which is why he has his credit in AUTHORS; so he does indeed have an understanding of the system and its code.

To get back on-topic...
We have a virtual method Window::isHit which can be used for non-standard hit-testing. Using masks for hit-testing is something that's reasonably straighforwards to put in, though my main concern has always been with clipping. While people may initially say not to worry about that, as soon as you have non-rectangular hit-testing people will then start asking why child windows are not clipped to the same 'hit' area, and that opens up a whole other can of worms. Honestly, the system was never really designed with this in mind, and I do think a major re-working of low-level parts would be required to implement the feature properly - and I'd rather not have a feature than have to settle for a quick hack. I'd never say never - just very unlikely (unless someone demonstrates this in a very high quality patch ;) ).

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: curved window

Postby gcarlton » Fri Jul 29, 2005 09:01

Hi,
Thanks, I didn't know that I got a mention. Nice! :)

That movitates me to try to clean up my version to get a proper rotating-images patch. One of these days I'm going to get sick of merging my tangle of differences each update and just do it. (But not today).

By clipping due you mean child windows rendering where they shouldn't? That does sound like a can of worms! Makes clipping rotated rects look like a walk in the park.

But for a simple circular button or such without that complication, it seems a feasible approach to derive a window and customise isHit().

Geoff

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

Re: curved window

Postby CrazyEddie » Sat Jul 30, 2005 12:20

Yeah, by clipping I mean that if you had a "round" control, any child widgets would still be clipped to the bounding rect, not the masked circular area.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 12 guests