This library is mostly to be used for obtaining a circular context menu, but can also be used to just layout Actors in a circular fashion.
In terms of User Interface, circular context menu "are faster and more reliable to select from than linear menus, because selection depends on direction instead of distance." (Wikipedia source). That is the whole motivation behind this library.
Here's a demo-gif:

I've also set up an online demo, for those of you that would rather try it out before trying to integrate it:
https://payne911.github.io/PieMenu/
----------------------------------------------------------------------
The library:
* is very well documented
* offers many out-of-the-box examples with their associated code
* is thoroughly tested
* is OpenSource (MIT)
* and is ready to receive some Pull Requests from the community.
Try it out, and let me know if you have any issues with it. (For the most part, I would recommend adding `Label`, `Stack`, or `Image` as children inside the Menu, but you are not restricted to those.)
Enjoy!

----------------------------------------------------------------------
For the more curious of you guys, here is what the code might look like:
- Code: Select all
/* Setting up and creating the widget. */
PieMenu.PieMenuStyle style = new PieMenu.PieMenuStyle();
style.sliceColor = new Color(.33f,.33f,.33f,1); // "style" variables affect the way the widget looks
PieMenu menu = new PieMenu(skin.getRegion("white"), style, 80); // "white" would be a 1x1 white pixel
/* Adding a listener. */
menu.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
System.out.println("The selected index is: " + menu.getSelectedIndex());
}
});
/* Populating the widget. */
for (int i = 0; i < 8; i++) {
Label label = new Label(Integer.toString(i), skin);
menu.addActor(label);
}
/* Including the Widget in the Stage. */
stage.addActor(menu);