API ReferenceGE Extensionsflowgraphnodesuiimguielemental
ImGui Begin
- **Node Name:** `im Begin`
Overview
- Node Name:
im Begin - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/imgui/elemental/imBegin.lua
Opens an ImGui window. Must be paired with an im End node. Supports positioning via anchor points (TL, TR, BL, BR).
Pin Schema
Input Pins
| Pin | Type | Default | Description |
|---|---|---|---|
title | string | - | Window title (nil = no title bar) |
width | number | 200 | Window width (hidden, hardcoded) |
height | number | 150 | Window height (hidden, hardcoded) |
posX | number | 100 | X position (hidden, hardcoded) |
posY | number | 100 | Y position (hidden, hardcoded) |
anchor | string | "TL" | Anchor corner: TL, TR, BL, BR (hidden, hardcoded) |
Output Pins
| Pin | Type | Description |
|---|---|---|
wasClosed | flow (impulse) | Fires once when the user closes the window |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Sets window size/position on first call, then calls im.Begin() each frame |
_executionStarted() | Resets the done flag so position is set on next execution |
Anchor System
Position is computed relative to one of four screen corners using Canvas:clientToScreen():
| Anchor | Behavior |
|---|---|
TL | posX/posY from top-left |
TR | posX from right edge, posY from top |
BL | posX from left, posY from bottom edge |
BR | posX from right, posY from bottom |
Window ID
The window is identified by title .. '##' .. self.id to ensure uniqueness even with duplicate titles.
How It Works
- On first
work()call, setsim.SetNextWindowSizeand computes screen position from anchor. - Every frame, calls
im.Begin(title, boolPtr, flags). - If title is nil, the
NoTitleBarflag is used. - If the user closes the window (clicks X),
wasClosedimpulse fires. - All ImGui elements between this node and the matching im End node are drawn inside this window.
Usage Example
-- Flowgraph chain:
-- [im Begin (title="My Window", width=300, height=200)]
-- → [im Text (text="Hello!")]
-- → [im Button (text="Click Me")]
-- → [im End]
-- Under the hood:
im.SetNextWindowSize(im.ImVec2(300, 200))
im.Begin("My Window##42", boolPtr, nil)
-- ... child elements ...
im.End()Key Dependencies
ui_imgui- ImGui bindingsscenetree.findObject("Canvas")- for anchor position calculation
See Also
- im Button (Flowgraph Node) - Related reference
- im Checkbox (Flowgraph Node) - Related reference
- im Color (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide