Rolly Docs

Offer choices on a radial

Let a player pick one of up to eight choices on a ring with a stick, the directional pad, the mouse, keys 1 to 8 or a finger: quick wheels, emotes, an object's options.

Sheet
15 of 45
Rev
1.2.0
Updated
On this sheet
Figure 1. Six choices, Lock unavailable: the pointed one is outlined, the centre names it and shows a held confirm's progress, the prompts under the ring.

Point, confirm and close

Action Gamepad Keyboard and mouse Touch
Point either stick, leaned past 0.35; the directional pad steps (Right and Down clockwise) move the mouse away from the centre; the arrows step; 1 to 8 point and confirm at once touch a sector
Confirm A, or the radial’s confirm keys Enter, Space, the left button or the confirm keys lift the finger on the sector; keep it there to hold
Close B Escape or the right button tap outside the ring
  • A confirm held stays held: the entry is pressed until the key, button or finger lets go (your game can show its progress around the centre), then the radial closes. A second confirm key, or a second finger, changes nothing meanwhile; focus or the mouse taken away (another window) lets the hold go.
  • Letting go of a stick keeps the last choice pointed, from a diagonal too.
  • An unavailable entry can be pointed: it shows dimmed with a lock, its reason in the centre, and a confirm on it plays the Error sound and says the reason.
  • The radial is that player’s modal: their look and move stop while it is open, the other players play on and nothing pauses.
  • The mouse pointer hides while the radial is open and its moves point; the radial holds the mouse, so a click confirms and the pointer stays in the game. A radial subclass with Show Mouse Cursor on keeps the pointer, free, and points at the sector under it. Only the radial’s player’s pointer and fingers count; another player’s mouse passes on to the game. While a screen is open over the radial, the radial takes no input and gives the mouse back.
  • Menu narration reads the radial opening (“4 options. Open, press E, 1 of 4.”) and each entry pointed, with its state and place; an entry without a label (an emote shown by its icon) is read by its Id.

Open a radial

Each choice is a Rolly Settings Core UI Radial Entry:

Entry field What it does
Id The name your events receive.
Label The sector’s text, two lines at most.
Icon A picture above the label.
Hint The centre’s second line while the entry is pointed (“Hold”).
Enabled, Reason Off: dimmed with a lock; the Reason shows in the centre and is spoken on a confirm.
Keyboard Key, Gamepad Key A key cap on the sector for the player’s device.
Spoken Text, Spoken Brief What narration says for the entry instead of its label.

Blueprint

Open Rolly Radial with the player controller, the entries, the entry to point at first and the keys that confirm besides Accept (the keys of the action the radial chooses for), then bind On Radial Confirm Pressed, On Radial Confirm Released, On Radial Refused and On Radial Pointed on the radial it returns.

C++

TArray<FRollySettingsCoreUIRadialEntry> Entries;
FRollySettingsCoreUIRadialEntry& Open = Entries.AddDefaulted_GetRef();
Open.Id = TEXT("Open");
Open.Label = LOCTEXT("Open", "Open");
FRollySettingsCoreUIRadialEntry& Lock = Entries.AddDefaulted_GetRef();
Lock.Id = TEXT("Lock");
Lock.Label = LOCTEXT("Lock", "Lock");
Lock.bEnabled = false;
Lock.Reason = LOCTEXT("NeedsKey", "Needs the cellar key");

if (URollySettingsCoreUIRadial* Radial = URollySettingsCoreUIRadial::OpenRadial(PlayerController, nullptr, Entries, 0, InteractKeys))
{
	Radial->OnConfirmPressed().AddUObject(this, &UMyDoorMenu::HandlePressed);   // start what the entry does
	Radial->OnConfirmReleased().AddUObject(this, &UMyDoorMenu::HandleReleased); // end a hold
}
C++

Hold a choice, or make a quick wheel

  • For an action that takes time, call Set Confirm Progress while the confirm is held; On Radial Confirm Released tells you it was let go, naming the entry as it was pressed. Close On Release off keeps the radial open for another choice.
  • Confirm Mode Release makes a quick wheel: open the radial on a key’s press, call Set Open Key with it, and letting the key go picks the entry pointed at.
  • Update Entry changes an entry while the radial is open (an option that turned available); Set Entries with new entries lets a held confirm go first.
  • A screen that opens over the radial, in On Radial Confirm Released too (a shop, a question), lets go of a held confirm and stays open; the radial closes when that screen does.

Change the look

A subclass of Rolly Radial sets its class defaults:

Setting What it does
Ring Size, Centre Size, Sector Gap The ring’s width, the centre’s and the gap between sectors, at Standard density (400, 160, 4). A Centre Size past nine tenths of Ring Size is a setup error, drawn as nine tenths.
Stick Threshold How far a stick leans before it points (0.35).
Pointer Dead Zone How far the mouse moves from the centre before it points (24).
Touch Hold Delay How long a finger rests before it holds the entry (0.3 s).
Scrim Opacity How strongly the player’s part of the screen dims (0.4).
Confirm Mode, Close On Release See above.
Item Class The widget on each sector: a subclass of Rolly Radial Item. One that cannot be made (abstract or deprecated) shows Rolly Radial Items, with a setup message.

The theme draws the sectors in Surface Raised and the pointed one with its focus look; the focus colour shows only on the pointed sector’s outline and the held confirm’s progress. A Widget Blueprint subclass lays the radial out by naming its widgets like the parts: Scrim, Sectors, ItemPanel, CentreDisc, CentreLabel, CentreHint, CentreRing and PromptBar; an item’s parts are Icon, LabelText, LockIcon and KeyGlyph, and a Blueprint item changes its look on the pointed sector in On Pointed Changed (or reads Is Pointed). Override MakeOpenedLine and MakePointedLine to say the radial your way.

Limits

  • Eight entries at most: more are left out with a setup message.