Loading
Docs / Components / Radio Buttons
v1.0.0 JAVA MOD LIBRARY

Radio Buttons

Rotated 45-degree diamond radio control with a 3-tone beveled center dot.

ui.radio(...) renders a 22×22 (OreUi.RADIO_SIZE) rotated -45deg diamond with a 4-quadrant beveled inner dot (variant.dotTop, variant.dotSide, variant.dotBottom) when selected. Unselected radios share the neutral grey #8C8D90 face; selected radios adopt the active OreVariant palette.

Interactive Preview & Matrix

State
Colored
General
Destructive
Warning
Realms
On (Default)
On (Hover)
On (Focused)
Off (Default)
Disabled

Method Signature (OreUi)

public void radio(int x, int y, boolean selected, OreVariant variant,
                  boolean enabled, boolean focused, String tip, Runnable action)

Parameters

ParameterTypeDescription
x, yintTop-left GUI pixel coordinates (22×22 box).
selectedbooleanWhether this option is selected (shows variant face and beveled center diamond).
variantOreVariantActive palette when selected (null defaults to OreVariant.COLORED).
enabledbooleanEnables interaction (false halves opacity of content/dot).
focusedbooleanForces the rotated white diamond focus ring around the control.
tipStringOptional hover tooltip.
actionRunnableInvoked when clicked or activated via Enter/Space.

Example

String[] difficulties = { "Normal", "Hard" };
for (int i = 0; i < difficulties.length; i++) {
	int idx = i;
	int ry = y + i * 26;
	ui.radio(x, ry, selectedDiff == i, OreVariant.COLORED, true, false,
		"Choose " + difficulties[i], () -> selectedDiff = idx);
	ui.text(difficulties[i], x + 28, ry + 7, OreTone.TEXT);
}