ImGuiSystem

EntitySystemceramic.ImGuiSystem (Class)

Dear ImGui integration for ceramic - fully backend-agnostic.

Everything goes through ceramic itself, so the SAME code runs on clay (native + web) and unity:

  • INPUT: ceramic events are forwarded to ImGui's 1.87+ event queue (addMousePosEvent, addKeyEvent, ...), text goes through ceramic's text input sessions (IME-aware), driven by io.wantTextInput.
  • FRAME: newFrame() at early update (before user code builds its UI in update()), render() at late update.
  • RENDERING: ImGuiRenderable consumes the draw data through the concrete backend.Draw during the normal visuals pass (no imgui_impl_* backend).
  • TEXTURES: the 1.92 ImTextureData protocol handled with ceramic textures; ImTextureID is a registry key (see ImGuiTextures).

Usage stays the same as before: make ImGui.* calls anywhere between updates (typically in update()); frame boundaries are automatic.

Static Members

imgui
DEFAULT_FONT: String

Name of the default font bundled with the plugin (Roboto-Medium), used when the project does not provide its own imgui_font define.


imgui
DEFAULT_FONT_FALLBACK: String

Name of the default fallback font bundled with the plugin (Kosugi, for CJK glyph coverage), merged into the default font.


imgui
shared: ImGuiSystem

Shared ImGui system instance. Automatically created when first accessed.

Instance Members

imgui
wantCaptureMouse: Bool

True when ImGui wants the mouse (apps should ignore clicks then).


imgui
wantCaptureKeyboard: Bool

True when ImGui wants the keyboard.


imgui
renderable: ImGuiRenderable

The renderable that draws ImGui (its depth places the UI, default topmost).


imgui
customFont: imgui.ImGuiFontPtr

The custom font loaded from the imgui_font define (if any). It is also assigned to io.fontDefault; use it with ImGui.pushFontFloat(customFont, size) for per-window sizes.


imgui
wheelScale: Float

Multiplier applied to ceramic wheel deltas before feeding ImGui. The default (1/24) is calibrated for a comfortable trackpad feel with ceramic's wheel units; raise it if a notched mouse wheel feels too slow.

Private Members

imgui
inited: Bool

imgui
frameStarted: Bool

imgui
textInputActive: Bool

imgui
lastTextInputText: String

imgui
loadScript(src: String, done: Function): Void
Name Type
src String
done Function

imgui
imguiMouseButton(buttonId: Int): Int
Name Type
buttonId Int
Returns
Int

imgui
start(done: Function): Void
Name Type
done Function

imgui
initImGui(): Void

imgui
loadFont(fontId: String, ?fallbackId: String): Void

Load fontId as the default ImGui font and, if fallbackId is provided, merge its glyphs (e.g. CJK) into it. Both are binary asset names.

Name Type Default
fontId String
fallbackId String (optional)

imgui
earlyUpdate(delta: Float): Void
Name Type
delta Float

imgui
lateUpdate(delta: Float): Void
Name Type
delta Float

imgui
bindInput(): Void

imgui
forwardKey(key: Key, down: Bool): Void
Name Type
key Key
down Bool

imgui
updateTextInputSession(want: Bool): Void

Characters flow through ceramic's text input sessions (IME-aware): we open a session while ImGui wants text, and forward what gets typed by diffing the session buffer (editing keys are handled by ImGui itself through the key events).

Name Type
want Bool

imgui
handleTextInputUpdate(text: String): Void
Name Type
text String

imgui
new(): Void

Metadata

Name Parameters
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()