Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/dwm/ext/imgui.ts>imgui

Deno Window Manager: Cross-platform window creation and management
Go to Latest
namespace imgui
Re-export
import { imgui } from "https://deno.land/x/dwm@0.3.2/ext/imgui.ts";

Functions

vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)

square button with an arrow shape

lock horizontal starting position

draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses

button

width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.

checkbox

add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.

ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!

unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)

== GetContentRegionMax() - GetCursorPos().

current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates.

cursor position in window coordinates (relative to window position)

cursor position in absolute coordinates (useful to work with ImDrawList API). generally top-left == GetMainViewport()->Pos == (0,0) in single viewport mode, and bottom-right == GetMainViewport()->Pos+Size == io.DisplaySize in single-viewport mode.

initial cursor position in window coordinates

valid after Render() and until the next call to NewFrame(). this is what you have to render.

FontSize + style.FramePadding.y * 2

FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)

calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself

access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)

get maximum scrolling amount ~~ ContentSize.x - WindowSize.x - DecorationsSize.x

get maximum scrolling amount ~~ ContentSize.y - WindowSize.y - DecorationsSize.y

get scrolling amount [0 .. GetScrollMaxX()]

get scrolling amount [0 .. GetScrollMaxY()]

access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame!

FontSize

FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)

get the compiled version string e.g. "1.80 WIP" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp)

content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates.

content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates.

get DPI scale currently associated to the current window's viewport.

get draw list associated to the current window, to append your own drawing primitives

get current window height (shortcut for GetWindowSize().y)

get current window position in screen space (useful if you want to do your own drawing via the DrawList API).

get current window size.

get viewport currently associated to the current window.

get current window width (shortcut for GetWindowSize().x)

move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0

flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)

is current window focused? or its root/child, depending on flags. see flags for options.

is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!

start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().

undo a SameLine() or force a new line when in a horizontal-layout context.

pop from the ID stack.

== tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets

in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.

use NULL as a shortcut to push default font

push string into the ID stack (will hash id).

push width of items for common large "item+label" widgets. >0.0f: width in pixels.; <0.0f: align xx pixels to the right of window (so -FLT_MIN always align width to the right side).

modify a style color. always use this if you modify the style after NewFrame().

modify a style float variable. always use this if you modify the style after NewFrame().

push word-wrapping position for Text*() commands. <0.0f: no wrapping; 0.0f: wrap to end of window (or column); >0.0f: wrap at 'wrap_pos_x' position in window local space

ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData().

call between widgets or groups to layout them horizontally. X position given in window coordinates.

separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.

cursor position in absolute coordinates

set width of the next common large "item+label" widget. >0.0f: width in pixels; <0.0f: align xx pixels to the right of window (so -FLT_MIN always align width to the right side).

set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.

set next window collapsed state. call before Begin()

set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin()

set next window to be focused / top-most. call before Begin()

set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.

set next window scrolling value (use < 0.0f to not affect a given axis).

set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()

set next window viewport

adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.

adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.

adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead.

adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead.

set scrolling amount [0 .. GetScrollMaxX()]

set scrolling amount [0 .. GetScrollMaxY()]

set named window collapsed state

set named window to be focused / top-most. pass undefined or empty string to remove focus.

set named window position.

set named window size. set axis to 0.0f to force an auto-fit on this axis.

create About window. display Dear ImGui version, credits and build/system information.

create Debug Log window. display a simplified log of important dear imgui events.

create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!

add font selector block (not a window), essentially a combo listing the loaded fonts.

create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.

create Stack Tool window. hover items with mouse to query information about the source of their unique ID.

add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)

add style selector block (not a window), essentially a combo listing the default styles.

add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls).

button with FramePadding=(0,0) to easily embed within text

add vertical spacing.

classic imgui style

new, recommended style (default)

best used with borders and a custom, thicker font

move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0

vertical silder

vertical silder