API ReferenceGE Extensionsflowgraphnodesuiimguielemental
ImGui Checkbox
- **Node Name:** `im Checkbox`
Overview
- Node Name:
im Checkbox - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/imgui/elemental/imCheckbox.lua
Displays an interactive checkbox in an ImGui window with enable/disable support and programmatic set/unset.
Pin Schema
Input Pins
| Pin | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Whether the checkbox is interactive (hidden, hardcoded) |
setOn | flow | - | Impulse to check the box (hidden) |
setOff | flow | - | Impulse to uncheck the box (hidden) |
text | any | - | Label text for the checkbox |
Output Pins
| Pin | Type | Description |
|---|---|---|
on | flow | Active when box is checked |
off | flow | Active when box is unchecked |
changed | flow (impulse) | Fires when state changes (hidden) |
checked | bool | Current checked state |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Handles programmatic set/unset, draws checkbox, updates outputs |
_executionStarted() | Initializes state from data.startState |
Data Properties
| Property | Default | Description |
|---|---|---|
data.startState | false | Initial checked state |
Disabled State
When enabled is false, the checkbox is wrapped in im.BeginDisabled() / im.EndDisabled(), making it visible but non-interactive.
How It Works
- Checks
setOn/setOffimpulse inputs to programmatically toggle state. - If
enabledis false, wraps the checkbox in disabled mode. - Draws
im.Checkbox(text, boolPtr)and checks if the user toggled it. - Sets
on/offflow outputs based on current state, andchangedimpulse if state changed. - Outputs the boolean
checkedvalue.
Usage Example
-- Flowgraph:
-- [im Begin] → [im Checkbox (text="Enable Sound")]
-- → (on) → [Enable Sound System]
-- → (off) → [Disable Sound System]
-- → (changed) → [Log State Change]
-- Under the hood:
local val = im.BoolPtr(self.state)
if im.Checkbox("Enable Sound##42", val) then
self.state = val[0] -- user toggled
endKey Dependencies
ui_imgui- ImGui bindings (Checkbox,BeginDisabled,EndDisabled)
See Also
- im Begin (Flowgraph Node) - Related reference
- im Button (Flowgraph Node) - Related reference
- im Color (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide