API Reference

This page documents the wrapper functions we have for the imgui-node-editor API.


ImGuiNodeEditor.@with_font_scale — Macro
@with_font_scale scale body

Run body with a font pushed so text drawn inside the node canvas renders at scale× the base font size as measured on screen, regardless of zoom. The canvas magnifies the draw list by current_scale, so the local font is sized to scale / current_scale() and the glyphs are baked at their on-screen size (rasterizer density = the magnification, snapped to a power of two) — this keeps them crisp rather than minifying a too-large atlas (which aliases). Font and rasterizer density are restored afterwards; body's value is forwarded.

For example, a node title that stays readable (capped at 1× on screen) when zooming out but grows freely when zooming in:

@with_font_scale max(1f0, current_scale()) draw_title()
source
ImGuiNodeEditor.BeginCreate — Function
BeginCreate() -> Bool
BeginCreate(
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T}
) -> Bool
BeginCreate(
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T},
    thickness
) -> Bool

Upstream link.

source
ImGuiNodeEditor.Link — Function
Link(
    id,
    startPinId::ImGuiNodeEditor.lib.PinId,
    endPinId::ImGuiNodeEditor.lib.PinId
) -> Bool
Link(
    id,
    startPinId::ImGuiNodeEditor.lib.PinId,
    endPinId::ImGuiNodeEditor.lib.PinId,
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T}
) -> Bool
Link(
    id,
    startPinId::ImGuiNodeEditor.lib.PinId,
    endPinId::ImGuiNodeEditor.lib.PinId,
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T},
    thickness
) -> Bool

Upstream link.

source
ImGuiNodeEditor.QueryDeletedLink — Function
QueryDeletedLink(
    linkId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.LinkId}}
) -> Bool
QueryDeletedLink(
    linkId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.LinkId}},
    startId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}}
) -> Bool
QueryDeletedLink(
    linkId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.LinkId}},
    startId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    endId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}}
) -> Bool

Upstream link.

source
ImGuiNodeEditor.QueryNewLink — Function
QueryNewLink(
    startId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    endId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T}
) -> Bool
QueryNewLink(
    startId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    endId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T},
    thickness::Real
) -> Bool

Upstream link.

source
ImGuiNodeEditor.QueryNewNode — Function
QueryNewNode(
    pinId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T}
) -> Bool
QueryNewNode(
    pinId::Union{Ptr{Nothing}, Ref{ImGuiNodeEditor.lib.PinId}},
    color::Union{CImGui.lib.ImVec4, NTuple{4, T} where T},
    thickness::Real
) -> Bool

Upstream link.

source
ImGuiNodeEditor.current_scale — Method
current_scale() -> Float32

Factor by which the canvas magnifies drawn content on screen: > 1 when zoomed in, < 1 when zoomed out. This is the reciprocal of GetCurrentZoom, which returns the canvas InvScale (and so reads backwards). Returns 1 when no editor is active, or when the zoom is non-positive (which a corrupt settings file or a bad CustomZoomLevels can produce).

source