reckfellENGINE

ButtonGroup

Shared selection resource for toggle buttons.

On this page
class ButtonGroupReckfellSharpInherits Resource

Assign one ButtonGroup instance to related buttons with ToggleMode = true. Different instances do not form one group. By default the resource is local to a level instance; it tracks membership without owning Control lifetimes.

AllowUnpress defaults to false and prevents repeated activation from deselecting the current button. It does not guarantee that one item is always selected: groups start empty, SetPressed(false) can clear selection, SetPressedNoSignal bypasses reconciliation, and group assignment does not normalize existing states. Set the initial selection explicitly.

GetPressedButton returns a selected button or null. If code created multiple selected items, the result depends on unordered traversal; restore consistent state first. GetButtons returns shared references without tree-order guarantees. Editing this array does not change membership; set the button’s ButtonGroup = null to detach it.

Pressed supplies the button processed by group activation or ordinary SetPressed(true) selection. With AllowUnpress = true, activation may already have switched the supplied button off. Read ButtonPressed/GetPressedButton when you need final selection rather than the action source.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

ButtonGroupConstructor
# ButtonGroup
C#
public ButtonGroup();

Creates an empty group with AllowUnpress = false and ResourceLocalToScene = true. Set initial selection explicitly.

Properties1

AllowUnpressProperty
# AllowUnpress
C#
public bool AllowUnpress { get; set; }

Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.

Methods4

GetButtonsReckfell.Collections.Array<BaseButton>
# GetButtons
C#
public Reckfell.Collections.Array<BaseButton> GetButtons();

Returns shared member references without tree-order guarantees. Editing the array does not change membership and does not transfer ownership of buttons. Detach by assigning null to the button’s ButtonGroup.

Returns Reckfell.Collections.Array<BaseButton>

Array of shared BaseButton references without stable ordering.

GetPressedButtonBaseButton
# GetPressedButton
C#
public BaseButton GetPressedButton();

Returns a selected member or null. Multiple selections created by inconsistent programmatic writes produce an unordered-traversal-dependent result.

Returns BaseButton

Selected BaseButton, or null.

IsAllowUnpressbool
# IsAllowUnpress
C#
public bool IsAllowUnpress();

Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.

Returns bool

true when repeated activation may clear selection.

SetAllowUnpressvoid
# SetAllowUnpress
C#
public void SetAllowUnpress(bool enabled);

Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.

Parameters
NameTypeDefault
enabledbool—
enabled

Permit repeated activation to clear current selection, default false. Does not forbid programmatic SetPressed(false), an initially empty group or SetPressedNoSignal bypass.

Signals and events1

PressedEvent
# Pressed
C#
public event ButtonGroup.PressedEventHandler Pressed;

Supplies a member on activation or ordinary SetPressed(true) selection. With AllowUnpress, that member may already be off. Not a universal final-selection signal; SetPressedNoSignal does not emit it.

Handler parameters
NameTypeDefault
buttonBaseButton—
button

Member causing notification; inspect its ButtonPressed for final state.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.