Alpha testing and getting textures

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

SamBarham
Just popping in
Just popping in
Posts: 5
Joined: Tue Oct 17, 2006 03:46

Alpha testing and getting textures

Postby SamBarham » Fri Nov 10, 2006 02:18

OK, so I require alpha tested buttons, so that I can have non-square buttons. I'm quite happy to fluff around in the source and hack in the bits that I want (at least for now), and I've written my own renderer, so the platform specific parts of accessing a texture and figuring out an alpha value under the mouse will be fine, but I do have a problem that is getting in the way.

In my buttons isHit() method that I am overriding, I need to get access to the CEGUI texture that will be used when the button is rendered. How on earth do I do that? The texture access seems to be buried under layers of image sets and looknfeels and schemes and falagard and everything, and I'm slightly lost as to how to figure out which actual texture will be used on render

Any ideas?

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

Postby CrazyEddie » Mon Nov 13, 2006 10:01

You are correct that the Windows do not have access to that level of information, and that was by design.

What you need to do is to set the user data or some user string to an appropriate data which allows you to obtain access to the mask (which you must provide your own means to access - but you've already done that, so no problem!).

So, you could use Window::setUserData (void *user_data) or Window::setUserString (const String &name, const String &value) and then within the isHit method you get that data and use it to access the texture (whether that data be a pointer or a name of a texture you could look up or whatever).

Hope this gives a few hints :)

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 20 guests