non-rectangular image button clicking

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

andrew_l
Just popping in
Just popping in
Posts: 1
Joined: Sat Sep 20, 2008 02:14

non-rectangular image button clicking

Postby andrew_l » Sat Sep 20, 2008 02:35

I'm fairly new to CEGUI 0.6, so I apologize if I'm asking for something which might already exist. But here it goes....

I've created several ImageButtons which are not rectangular, using Taharez L&F so that I get ImageButtons. I figured out how to get the Alpha information to be saved in the TGA used in my imageset from Photoshop; certain parts of the buttons have partial transparency, and there are also parts with total transparency.

When I go to click a button, the entire rectangular area is clickable, including the areas which are completely transparent. This is not what I want to happen.

What I would really like to do is to either (1) assign a picking mask which would determine where the button is clickable or not clickable, or (2) read the alpha channel information in the image for the button, and ignore any clicks on 100% transparent pixels.

Is there is already a solution to do something like this in CEGUI? I've made something similar before in JAVA by subclassing a JButton. I realize that it is probably likely that I can subclass the PushButton and implement a customized widget, but are there any other options? Or tips?

Any help would be greatly appreciated.
- Andrew

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Sat Sep 20, 2008 09:50

Hi and welcome :)

I'm affraight that the best option would be to create something custom by yourself. If you search this forum (no offence meant) for "round button" or such you will find some more discusstions.

Your idea about applying a "picking mask" as an extra layer actually sounds nice by design, as it could be implemented at a fairly low level, independent of the widget type and such.

HTH :)
Check out my released snake game using Cegui!


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 15 guests