Skip to content

Examples

payne911 edited this page Sep 30, 2019 · 28 revisions

Examples

Each example described here starts with a title which is a link to an example code that implements it, followed a textual description of its expected behavior. Finally, a GIF to demonstrate its functionality is provided.

Those examples are mostly there for you to get an idea of what is possible, and so that you can easily set yourself up by copying some code. The actual customization of the behavior and look of your Widget goes beyond what is demonstrated and you are encouraged to explore the multiple possibilities provided: you should adapt the Widget to your specific needs and requirements.


This menu remains displayed until you want it gone. It restricts the detection of interactions to the radius of the Widget itself: clicking outside of it will not affect its state.

To get it to feel a bit more integrated in the window, only a half-circle is drawn at the edge of the screen, rather than floating in the middle of nowhere.

It has an initially selected item, and will always keep displaying whatever selection the user has made (the item remains highlighted).

This menu will be displayed only when the user clicks the desired mouse-button (the middle-click, here). Once it is revealed, the user is free to select any option.

There are no restrictions applied to the range of detection of the input click of the user (left-click!): no matter how far the user clicks, the Widget will deduct and select the desired item.

When the Widget is revealed to the user, his last-selected item will not be highlighted.

This menu overrides the default selection button to be the right-click. It is also set to be displayed when the user does a right-click. This specific setup gives us one of the most efficient context menu there is: the user presses the right-click, does not release it, and simply drags/moves the mouse in the direction of the desired item. It is the act of releasing the click which actually selects the item. This is a fundamental principal of how circular context menu may work.

There are no restrictions applied to the range of detection of the input click of the user (left-click!): no matter how far the user clicks, the Widget will deduct and select the desired item.

The Widget registered a HighlightChangeListener and thus allows immediate feedback to the user whenever the currently highlighted item is changed (and thus no actual selection is required for that to happen).

Whenever the Widget appears on the screen, it will still show the last selected item as highlighted.

This is a simple Radial Group Widget, and not a Pie Menu. Its visibility is toggled by the pressing of a button.

Radial Groups are used to display its children Actors in a circular fashion. They are nothing more than containers, and do not provide any other functionalities.

This menu is "attached" to a TextButton. As soon as the user clicks the button, he is presented with the Pie Menu and can quickly select a choice among the presented items. To do so, the user must not release its left-click, and simply drags/moves the mouse in the direction of the desired item. It is the act of releasing the click which actually selects the item. This is a fundamental principal of how circular context menu may work.

Upon release, the TextButton changes its text to reflect the user's selection.

When the user summons the Widget again, it will not be highlighting his last-selected item.