Hi, all
I'm making a UI control that kind of like the GridLayoutContainer, but it could make constraints on the width/height of some columns or rows.
When the size of the cell is determined by client's specified value, I wanna clip the child window inside the cell.
My question is how to clip the a child window with the area of the cell it resides in. Or in another word, how to clip children windows with a given Rect?
I don't quite want to change the size of the children windows, by which I will have to remember the original size of them in case of the re-layouting.
Thanks in advance.
How to clip the child windows with given rect
Moderators: CEGUI MVP, CEGUI Team
Re: How to clip the child windows with given rect
I don't think this is possible without custom a window renderer.
As a workaround you could put them into a fake window that would represent the rect and make them "ClippedByParent".
As a workaround you could put them into a fake window that would represent the rect and make them "ClippedByParent".
Re: How to clip the child windows with given rect
I do have written a WindowRenderer (but it is just for rendering separator & frame anyway), how can i use it to clip the children windows?
I'm thinking about using GeometryBuffer::setClippingRegion for this task. Is it a viable method?
I'm thinking about using GeometryBuffer::setClippingRegion for this task. Is it a viable method?
Re: How to clip the child windows with given rect
This can be done (I think) but you have to have a special renderer for all children and that renderer will merge the clip rect with your rect. I think the easiest solution is to use a dummy wrapper default window that will clip children to itself.
Re: How to clip the child windows with given rect
I tried SetClippingRegion and it does work, but the hitTest still failed, I think maybe this method needs a hack to add setUnclippedRect to CEGUI::Window...
Anyway, I think your method should be better.
Anyway, I think your method should be better.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 5 guests