[ANSWERED] Widgets with not a rectangular form

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

madeinsoviets
Just popping in
Just popping in
Posts: 13
Joined: Sat Feb 27, 2010 09:16

[ANSWERED] Widgets with not a rectangular form

Postby madeinsoviets » Sat Feb 27, 2010 09:22

Hello everyone...)
We are developing some kind of a simulater under Ogre3D and now we are choosing GUI system - so we have some requirements to it...
Are there any ways to creat widgets in CEGUI with not a rectangular form? For example circle button? Maybe some rectangular widgets with alpha culling? Point me a direction please..
Last edited by madeinsoviets on Mon Mar 01, 2010 08:49, edited 1 time in total.

madeinsoviets
Just popping in
Just popping in
Posts: 13
Joined: Sat Feb 27, 2010 09:16

Re: Widgets with not a rectangular form

Postby madeinsoviets » Sat Feb 27, 2010 15:27

Image

madeinsoviets
Just popping in
Just popping in
Posts: 13
Joined: Sat Feb 27, 2010 09:16

Re: Widgets with not a rectangular form

Postby madeinsoviets » Mon Mar 01, 2010 07:55

Hey, noone knows?

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

Re: Widgets with not a rectangular form

Postby CrazyEddie » Mon Mar 01, 2010 08:25

Hi,

Please don't bump posts that are only two posts down! Eventually I come here and see all posts, and will reply to any that have not otherwise been answered - though sometimes I do not come here every day; even I have days off or have other things that I have to get done ;)

To answer the question... While CEGUI is very much based upon the concept of rectangles, this may be possible, perhaps, depending upon the precise requirements :lol: Not a very straight forward answer...

There obviously is no function, createNonRectangularWindow - so any solution is going to be more involved than that ;) Also, I would say it's reasonably doubtful that a 'generic non-rectangular window' is easily achieved; any solution will need to be tailored specifically to the problem at hand. The way I see this, there are two main issues to be overcome 1) hit-testing the window area, and 2) clipping of child content.

1) You can hook into this process by overriding the Window::isHit function and rather testing for a point in a Rect, you would have to go off and do something else (depending on the exact nature of the window). Here 'something else' just means determining whether a point is within the 'red bit' of the posted image - how to do that is left as an exercise for the user!

2) Clipping is maybe more of an issue where it's required. If it's not required; if the window will have no child content, you're home and dry. Otherwise, you'll need to come up with something special. Clipping in CEGUI is very much a rectangular thing, and no real hooks exist to do anything else. However, you may still be able to come up with a solution using the RenderEffect interface - perhaps using a shader of some kind - to mask imagery outside the visible region. Definitely not something that's straight forwards, though.

So, to conclude... Possible? Perhaps, depending on the exact needs. Easy? Certainly not something for the faint hearted ;)

HTH

CE.

madeinsoviets
Just popping in
Just popping in
Posts: 13
Joined: Sat Feb 27, 2010 09:16

Re: Widgets with not a rectangular form

Postby madeinsoviets » Mon Mar 01, 2010 08:48

Thanks a lot, sorry for importunity..)

r0br0y
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Thu Apr 08, 2010 09:36

Re: [ANSWERED] Widgets with not a rectangular form

Postby r0br0y » Mon Sep 13, 2010 09:09

Hi,

someone got masking of childwindows working? or somekind of tutorial/example?
I need some way to hide content of childwindows related to the alphachannel of a parented window...


thanks much!

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

Re: [ANSWERED] Widgets with not a rectangular form

Postby CrazyEddie » Mon Sep 13, 2010 09:24

The situation is largely as before: non-rectangular clipping / masking of rendered output is not supported, and in all honesty, will probably never be supported. There may (or may not) be ways to get this to work, perhaps involving use of stencils or shaders or what have you, though it will require the use of custom Window types and / or custom WindowRenderer types, it's not something I've tried, and is not something I can advise on in any meaningful way.

For hit-testing, I wrote a Wiki article about that, which you can see here: http://www.cegui.org.uk/wiki/index.php/ ... EGUI_0.7.x

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests