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

Last edited:
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.
 
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

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).
I rested sufficiently :)

Now you can choose the "menu item type": image, text or both (it's a property).
 

Attachments

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: 823
Thanks Erel! In B4I a number appears instead of the icon.
 

Attachments

  • IMG_2314.PNG
    IMG_2314.PNG
    196.9 KB · Views: 782
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:
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.
 
Can I put image for hexmenu like background not for items , how?
 
Status
Not open for further replies.
Back
Top