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..
[ANSWERED] Widgets with not a rectangular form
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 13
- Joined: Sat Feb 27, 2010 09:16
[ANSWERED] Widgets with not a rectangular form
Last edited by madeinsoviets on Mon Mar 01, 2010 08:49, edited 1 time in total.
-
- Just popping in
- Posts: 13
- Joined: Sat Feb 27, 2010 09:16
-
- Just popping in
- Posts: 13
- Joined: Sat Feb 27, 2010 09:16
Re: Widgets with not a rectangular form
Hey, noone knows?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Widgets with not a rectangular form
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 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.
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 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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
-
- Just popping in
- Posts: 13
- Joined: Sat Feb 27, 2010 09:16
Re: Widgets with not a rectangular form
Thanks a lot, sorry for importunity..)
Re: [ANSWERED] Widgets with not a rectangular form
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!
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!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: [ANSWERED] Widgets with not a rectangular form
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.
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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Who is online
Users browsing this forum: No registered users and 6 guests