An Hexagonal Widget can be made?

I have a little question:
I need to create an Hexagonal map using widgets.
How can I define a widget (a button widget I hope) to be hexagonal?
I need that also the sensible area is hexagonal so a IMAGE button doesn’t
work.
Thanks in advance
Marco Andolina

Xur <x@x.x.x> wrote:

I have a little question:
I need to create an Hexagonal map using widgets.
How can I define a widget (a button widget I hope) to be hexagonal?

I’m afraid you are stuck. All widgets are rectangular. That’s
just the way Photon perceives things. Even things like ellipses
are really rectangles with a visible ellipse held within the
rectangle.

I need that also the sensible area is hexagonal so a IMAGE button doesn’t
work.

The only suggestion that I can think of is to make your entire map
be a PtLabel (or perhaps a PtRaw). Inside an Arm or Activate
callback associated with the whole map, run some code that takes
the pointer location and decides which hexagon it is over, and
then does whatever is appropriate from there.

Sorry to disappoint, and I hope this suggests a usable
alternative.


Norbert Black
QSSL Training Services

Norbert Black <nblack@qnx.com> wrote:
: Xur <x@x.x.x> wrote:
:> I have a little question:
:> I need to create an Hexagonal map using widgets.
:> How can I define a widget (a button widget I hope) to be hexagonal?

: I’m afraid you are stuck. All widgets are rectangular. That’s
: just the way Photon perceives things. Even things like ellipses
: are really rectangles with a visible ellipse held within the
: rectangle.

:> I need that also the sensible area is hexagonal so a IMAGE button doesn’t
:> work.

: The only suggestion that I can think of is to make your entire map
: be a PtLabel (or perhaps a PtRaw). Inside an Arm or Activate
: callback associated with the whole map, run some code that takes
: the pointer location and decides which hexagon it is over, and
: then does whatever is appropriate from there.

I did something like that in a small game I developed. I used a hex based
map and used a routine which determined which row and column. I also
made an image with a transparent section so each hex had it’s own image.

It worked fine (once I had the math worked out for all the calculations. :slight_smile:

Rick…

Rick Duff Internet: rick@astra.mb.ca
Astra Network QUICS: rgduff
QNX Consulting and Custom Programming URL: http://www.astra.mb.ca
+1 (204) 987-7475 Fax: +1 (204) 987-7479