B4A Library [B4X] [XUI] HexMenu

Status
Not open for further replies.
Cross platform hexagons menu implemented as a custom view:

pQtXvSJZQ0.gif


Can show up to 7 items.

B4A project is attached. Class is supported by B4J and B4i as well. Depends on XUI and BitmapCreator libraries.

Example with gradient stroke:

i_view64_Ihv7fjyBRn.png

Version with gradient stroke: https://www.b4x.com/android/forum/threads/b4x-xui-hexmenu.112410/#post-700941
 

Attachments

  • HexMenu.zip
    11 KB · Views: 877
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that in your project you "try" to add 10 items (For i = 1 To 10)
True. I added more items as a test. It ignores the 8th and above items.

Now it is needed to add images inside the hexagons; who will do it?
Shouldn't be too difficult to do. There are several ways to add images. If the images are small so you don't need to deal with clipping then the simplest way is to add ImageViews in the same way that the labels are added.

It is also not too complicated to deal with clipping. It can be done by drawing with bc.DrawPath2 and a BCBrush that is based on a BitmapCreator.
 

LucaMs

Expert
Licensed User
Longtime User
Shouldn't be too difficult to do. There are several ways to add images. If the images are small so you don't need to deal with clipping then the simplest way is to add ImageViews in the same way that the labels are added.
Hexagon.png



As you know, I'm lazy :D, so I used a single image and I didn't manage the labels (superimpose them on the ImageViews or set a LabelsOnly property, for example).
 

Attachments

  • HexMenu2.zip
    16 KB · Views: 478

ThePuiu

Active Member
Licensed User
Longtime User
It is possible to add to the text and an image (FontAwesome)? Something like the attached image
 

Attachments

  • but.png
    but.png
    25.2 KB · Views: 340

ThePuiu

Active Member
Licensed User
Longtime User
Thanks Erel! In B4I a number appears instead of the icon.
 

Attachments

  • IMG_2314.PNG
    IMG_2314.PNG
    196.9 KB · Views: 379

amidgeha

Active Member
Licensed User
Longtime User
I have one of the hexmenu buttons that opens a browser using
B4X:
StartActivity(xph.OpenBrowser("http://mechanicalpowergen.com"))
when I press back the button text disappears when I press any other button in hexmenu.
 
Last edited:

amidgeha

Active Member
Licensed User
Longtime User
Cross platform hexagons menu implemented as a custom view:

pQtXvSJZQ0.gif


Can show up to 7 items.

B4A project is attached. Class is supported by B4J and B4i as well. Depends on XUI and BitmapCreator libraries.

Example with gradient stroke:

i_view64_Ihv7fjyBRn.png

Version with gradient stroke: https://www.b4x.com/android/forum/threads/b4x-xui-hexmenu.112410/#post-700941
I have one of the hexmenu buttons that opens a browser using
B4X:
StartActivity(xph.OpenBrowser("http://mechanicalpowergen.com"))
when I press back the button text disappears when I press any other button in hexmenu.
 

RUNO

Active Member
Licensed User
Longtime User
Can I put image for hexmenu like background not for items , how?
 
Status
Not open for further replies.
Top