RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraph

Flowgraph Node Builder

ImGui node builder that handles the visual layout and rendering of flowgraph nodes. Manages node stages (begin → header → content → input → middle → output → end), pin layout, and header texture rende

ImGui node builder that handles the visual layout and rendering of flowgraph nodes. Manages node stages (begin → header → content → input → middle → output → end), pin layout, and header texture rendering.

No public module exports - used internally by node drawing code.


Purpose

The builder orchestrates the ImGui draw calls for each flowgraph node. It tracks the current drawing stage, measures pin widths, renders headers with gradient textures, and provides debug rect overlays.


Class (C) - Key Methods

MethodSignatureDescription
init()Sets up default style: node rounding, padding, loads header texture from art/imgui_node_header_alt.png.
Begin(nodeID)Starts drawing a node. Pushes node padding style, begins the node editor node, sets stage to 'begin'.
End(node)Finishes drawing: calls customDrawEnd if present, renders header gradient texture, draws debug rects if enabled, pops styles.
Header(color)Stores header color and transitions to 'header' stage.
EndHeader()Transitions to 'content' stage.
Middle()Sets drawing stage for the center content area between pins.
Input(pin)Handles input pin layout. Transitions from 'begin' to 'content' if needed.
Output(pin)Handles output pin layout and alignment.
SetStage(stage)Manages stage transitions: invalid → begin → header → content → input → middle → output → end.
makeAlignmentPin(pin)Draws a hidden alignment pin for nodes with no visible input pins.
expectOutPinWidth(width)Pre-registers expected output pin width for alignment.
setExpectedHeaderSize(width)Records expected header text width for behavior icon placement.

Drawing Stages

begin → header → content → input → middle → output → end → invalid

Each stage configures ImGui cursor positions, spring layouts, and pin editor directives.


Rect Tracking

PropertyTypeDescription
NodeRectrectBounding rectangle of the entire node.
HeaderRectrectBounding rectangle of the header area.
ContentRectrectBounding rectangle of the content area (pins + middle).
-- Rect structure created by createRect():
local rect = {
  x = minR.x, y = minR.y,
  w = maxR.x - minR.x, h = maxR.y - minR.y,
  top_left = function() ... end,
  bottom_right = function() ... end,
}

Header Rendering

-- Header gradient is drawn as a rounded image on the node background draw list:
im.ImDrawList_AddImageRounded(drawList, self.headerTexture.texId,
  headerTopLeft, headerBottomRight,
  im.ImVec2(0, 0), uv,
  im.GetColorU322(self.HeaderColor),
  nodeRounding, 3) -- top corners only

Construction

-- Created via require, returns a constructor function:
local createBuilder = require('/lua/ge/extensions/flowgraph/builder')
local builder = createBuilder()  -- calls C:init()

Additional Exports

EndInput()

BeginPinDynamic(pin)

  • pin - any

EndPinDynamic(pin)

  • pin - any

EndOutput()

EndPin()


See Also

  • Flowgraph Base Module - Related reference
  • Flowgraph Base State Node - Related reference
  • Flowgraph Base Node - Related reference
  • FlowGraph Guide - Guide

Flowgraph Base State Node

Base class factory for state-graph nodes. Extends `basenode` with directional transition pins (N/E/S/W) for state-machine-style flowgraphs.

Flowgraph Graph

Core graph class that holds nodes, links, and pins for a single flowgraph. Manages node creation/deletion, execution planning, variable storage, and serialization. Each manager contains one or more gr

On this page

PurposeClass (C) - Key MethodsDrawing StagesRect TrackingHeader RenderingConstructionAdditional ExportsEndInput()BeginPinDynamic(pin)EndPinDynamic(pin)EndOutput()EndPin()See Also