I'm considering creating a patch (or an extension, or whatever it is called) to define windows that are not square shaped ... and I plan to it by using the alpha value of the image used for the window to determine the relevant part of the window( solid) and the irrevelant part (alpha=0). In that view, events like MouseEnter,MouseLeave or MouseClick would only be triggerred if the cursor is in the rectangle area and if the pixel under the hitting point has an alpha value different of 0.
My problem is that, in order to achieve this, I have to be able to consult the buffer linked to an imageset or, better, to the buffer of a particular image in an imageset... and I haven't found anyway to do this yet.
Anyone has an idea...i think it would be a nice feature to have
Alpha-based collision ?
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
There is no renderer independent way to do that at the moment. You can get the CEGUI::Texture object from the Imageset, but it offers no useful members for what you describe. Different implementations of CEGUI::Texture offer means to obtain the 'real' texture (like the OpenGL texture ID, or D3D texture interface), but as stated that's not renderer idependent
There are some plans afoot to change and extend considerably what a Renderer is and what can be accomplished. This very thing about pixel-perfect hit detection had crossed my mind when considering some of the ideas I have had for these extensions (whether that means I implement it or not, I do not know at this time).
So, at the moment, there's little to no access for what you want. In 0.6.0 things will be very different, and if we have not already implemented this feature, it should then, however, be possible to do so.
CE.
There are some plans afoot to change and extend considerably what a Renderer is and what can be accomplished. This very thing about pixel-perfect hit detection had crossed my mind when considering some of the ideas I have had for these extensions (whether that means I implement it or not, I do not know at this time).
So, at the moment, there's little to no access for what you want. In 0.6.0 things will be very different, and if we have not already implemented this feature, it should then, however, be possible to do so.
CE.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 4 guests
