Alpha-based collision ?

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

vimes
Just popping in
Just popping in
Posts: 10
Joined: Wed May 24, 2006 00:05

Alpha-based collision ?

Postby vimes » Sat Aug 05, 2006 03:35

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

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

Postby CrazyEddie » Sat Aug 05, 2006 21:28

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.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests