imgui

package module
v18500.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Dear ImGui for Go

Go wrapper for Dear Imgui v1.85.0

For project information see README in (master branch)[https://github.com/JetSetIlly/imgui-go]

Documentation

Overview

Package imgui contains all the functions to create an immediate mode graphical user interface based on Dear ImGui.

Index

Constants

View Source
const (
	// DragDropPayloadTypeColor3F is payload type for 3 floats component color.
	DragDropPayloadTypeColor3F = "_COL3F"
	// DragDropPayloadTypeColor4F is payload type for 4 floats component color.
	DragDropPayloadTypeColor4F = "_COL4F"
)
View Source
const (
	KeyTab         = 0
	KeyLeftArrow   = 1
	KeyRightArrow  = 2
	KeyUpArrow     = 3
	KeyDownArrow   = 4
	KeyPageUp      = 5
	KeyPageDown    = 6
	KeyHome        = 7
	KeyEnd         = 8
	KeyInsert      = 9
	KeyDelete      = 10
	KeyBackspace   = 11
	KeySpace       = 12
	KeyEnter       = 13
	KeyEscape      = 14
	KeyKeyPadEnter = 15
	KeyA           = 16 // for text edit CTRL+A: select all
	KeyC           = 17 // for text edit CTRL+C: copy
	KeyV           = 18 // for text edit CTRL+V: paste
	KeyX           = 19 // for text edit CTRL+X: cut
	KeyY           = 20 // for text edit CTRL+Y: redo
	KeyZ           = 21 // for text edit CTRL+Z: undo
)

Constants to fill IO.KeyMap() lookup with indices into the IO.KeysDown[512] array. The mapped indices are then the ones reported to IO.KeyPress() and IO.KeyRelease().

Variables

View Source
var ErrContextDestroyed = errors.New("context is destroyed")

ErrContextDestroyed is returned when trying to use an already destroyed context.

View Source
var ErrNoContext = errors.New("no current context")

ErrNoContext is used when no context is current.

View Source
var PackedColorModel = color.ModelFunc(func(in color.Color) color.Color { return Packed(in) })

PackedColorModel converts colors to PackedColor instances.

Functions

func AcceptDragDropPayload

func AcceptDragDropPayload(dataType string, flags DragDropFlags) []byte

AcceptDragDropPayload accepts contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.

func AlignTextToFramePadding

func AlignTextToFramePadding()

AlignTextToFramePadding vertically aligns 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.

func Begin

func Begin(id string) bool

Begin calls BeginV(id, nil, 0).

func BeginChild

func BeginChild(id string) bool

BeginChild calls BeginChildV(id, Vec2{0,0}, false, 0).

func BeginChildV

func BeginChildV(id string, size Vec2, border bool, flags WindowFlags) bool

BeginChildV pushes a new child to the stack and starts appending to it. flags are the WindowFlags to apply.

func BeginCombo

func BeginCombo(label, previewValue string) bool

BeginCombo calls BeginComboV(label, previewValue, 0).

func BeginComboV

func BeginComboV(label, previewValue string, flags ComboFlags) bool

BeginComboV creates a combo box with complete control over the content to the user. Call EndCombo() if this function returns true. flags are the ComboFlags to apply.

func BeginDragDropSource

func BeginDragDropSource(flags DragDropFlags) bool

BeginDragDropSource registers the currently active item as drag'n'drop source. When this returns true you need to: a) call SetDragDropPayload() exactly once, b) you may render the payload visual/description, c) call EndDragDropSource().

func BeginDragDropTarget

func BeginDragDropTarget() bool

BeginDragDropTarget must be called after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() and EndDragDropTarget().

func BeginGroup

func BeginGroup()

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

func BeginListBox

func BeginListBox(label string) bool

BeginListBox calls BeginListBoxV(label, Vec2{}).

func BeginListBoxV

func BeginListBoxV(label string, size Vec2) bool

BeginListBoxV opens a framed scrolling region. - This is essentially a thin wrapper to using BeginChild/EndChild with some stylistic changes. - The BeginListBox()/EndListBox() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() or any items. - The simplified/old ListBox() api are helpers over BeginListBox()/EndListBox() which are kept available for convenience purpose. This is analoguous to how Combos are created. - Choose frame width: size.x > 0.0f: custom / size.x < 0.0f or -FLT_MIN: right-align / size.x = 0.0f (default): use current ItemWidth - Choose frame height: size.y > 0.0f: custom / size.y < 0.0f or -FLT_MIN: bottom-align / size.y = 0.0f (default): arbitrary default height which can fit ~7 items.

func BeginMainMenuBar

func BeginMainMenuBar() bool

BeginMainMenuBar creates and appends to a full screen menu-bar. If the return value is true, then EndMainMenuBar() must be called!

func BeginMenu

func BeginMenu(label string) bool

BeginMenu calls BeginMenuV(label, true).

func BeginMenuBar

func BeginMenuBar() bool

BeginMenuBar appends to menu-bar of current window. This requires WindowFlagsMenuBar flag set on parent window. If the return value is true, then EndMenuBar() must be called!

func BeginMenuV

func BeginMenuV(label string, enabled bool) bool

BeginMenuV creates a sub-menu entry. If the return value is true, then EndMenu() must be called!

func BeginPopup

func BeginPopup(name string) bool

BeginPopup calls BeginPopupV(name, nil, 0).

func BeginPopupContextItem

func BeginPopupContextItem() bool

BeginPopupContextItem calls BeginPopupContextItemV("", PopupFlagsMouseButtonRight).

func BeginPopupContextItemV

func BeginPopupContextItemV(id string, flags PopupFlags) bool

BeginPopupContextItemV returns true if the identified mouse button was pressed while hovering over the last item.

func BeginPopupContextVoid

func BeginPopupContextVoid() bool

BeginPopupContextVoid calls BeginPopupContextVoidV("", PopupFlagsMouseButtonRight).

func BeginPopupContextVoidV

func BeginPopupContextVoidV(id string, flags PopupFlags) bool

BeginPopupContextVoidV open+begin popup when clicked in void (where there are no windows).

func BeginPopupContextWindow

func BeginPopupContextWindow() bool

BeginPopupContextWindow calls BeginPopupContextWindowV("", PopupFlagsMouseButtonRight).

func BeginPopupContextWindowV

func BeginPopupContextWindowV(id string, flags PopupFlags) bool

BeginPopupContextWindowV open+begin popup when clicked on current window.

func BeginPopupModal

func BeginPopupModal(name string) bool

BeginPopupModal calls BeginPopupModalV(name, nil, 0).

func BeginPopupModalV

func BeginPopupModalV(name string, open *bool, flags WindowFlags) bool

BeginPopupModalV creates modal dialog (regular window with title bar, block interactions behind the modal window, can't close the modal window by clicking outside). WindowFlags are forwarded to the window.

func BeginPopupV

func BeginPopupV(name string, flags WindowFlags) bool

BeginPopupV returns true if the popup is open, and you can start outputting to it. Only call EndPopup() if BeginPopup() returns true. WindowFlags are forwarded to the window.

func BeginTabBar

func BeginTabBar(strID string) bool

BeginTabBar calls BeginTabBarV(strId, 0).

func BeginTabBarV

func BeginTabBarV(strID string, flags TabBarFlags) bool

BeginTabBarV create and append into a TabBar.

func BeginTabItem

func BeginTabItem(label string) bool

BeginTabItem calls BeginTabItemV(label, nil, 0).

func BeginTabItemV

func BeginTabItemV(label string, open *bool, flags TabItemFlags) bool

BeginTabItemV create a Tab. Returns true if the Tab is selected.

func BeginTable

func BeginTable(id string, columnsCount int) bool

BeginTable calls BeginTableV(id, columnsCount, 0, imgui.Vec2{}, 0.0).

func BeginTableV

func BeginTableV(id string, columnsCount int, flags TableFlags, outerSize Vec2, innerWidth float32) bool

BeginTableV creates a table (Read carefully because this is subtle but it does make sense!) About 'outerSize', its meaning needs to differ slightly depending of if we are using ScrollX/ScrollY flags:

X:
- outerSize.x < 0.0f  ->  right align from window/work-rect maximum x edge.
- outerSize.x = 0.0f  ->  auto enlarge, use all available space.
- outerSize.x > 0.0f  ->  fixed width
Y with ScrollX/ScrollY: using a child window for scrolling:
- outerSize.y < 0.0f  ->  bottom align
- outerSize.y = 0.0f  ->  bottom align, consistent with BeginChild(). not recommended unless table is last item in parent window.
- outerSize.y > 0.0f  ->  fixed child height. recommended when using Scrolling on any axis.
Y without scrolling, we output table directly in parent window:
- outerSize.y < 0.0f  ->  bottom align (will auto extend, unless NoHostExtendV is set)
- outerSize.y = 0.0f  ->  zero minimum height (will auto extend, unless NoHostExtendV is set)
- outerSize.y > 0.0f  ->  minimum height (will auto extend, unless NoHostExtendV is set)

About 'innerWidth':

With ScrollX:
- innerWidth  < 0.0f  ->  *illegal* fit in known width (right align from outerSize.x) <-- weird
- innerWidth  = 0.0f  ->  fit in outer_width: Fixed size columns will take space they need (if avail, otherwise shrink down), Stretch columns becomes Fixed columns.
- innerWidth  > 0.0f  ->  override scrolling width, generally to be larger than outerSize.x. Fixed column take space they need (if avail, otherwise shrink down), Stretch columns share remaining space!
Without ScrollX:
- innerWidth          ->  *ignored*

Details:

  • If you want to use Stretch columns with ScrollX, you generally need to specify 'innerWidth' otherwise the concept of "available space" doesn't make sense.
  • Even if not really useful, we allow 'innerWidth < outerSize.x' for consistency and to facilitate understanding of what the value does.

func BeginTooltip

func BeginTooltip()

BeginTooltip begins/appends to a tooltip window. Used to create full-featured tooltip (with any kind of contents). Requires a call to EndTooltip().

func BeginV

func BeginV(id string, open *bool, flags WindowFlags) bool

BeginV pushes a new window to the stack and start appending to it. You may append multiple times to the same window during the same frame. If the open argument is provided, the window can be closed, in which case the value will be false after the call.

Returns false if the window is currently not visible. Regardless of the return value, End() must be called for each call to Begin().

func Bullet

func Bullet()

Bullet draws a small circle and keeps the cursor on the same line. Advance cursor x position by TreeNodeToLabelSpacing(), same distance that TreeNode() uses.

func Button

func Button(id string) bool

Button calls ButtonV(id, Vec2{0,0}).

func ButtonV

func ButtonV(id string, size Vec2) bool

ButtonV returns true if it is clicked.

func CalcItemWidth

func CalcItemWidth() float32

CalcItemWidth returns the width of items given pushed settings and current cursor position.

func Checkbox

func Checkbox(id string, selected *bool) bool

Checkbox creates a checkbox in the selected state. The return value indicates if the selected state has changed.

func ClearActiveID

func ClearActiveID()

ClearActiveID removes focus from a currently item in edit mode. An application that handles its own undo/redo stack needs to call this function before changing the data a widget might currently own, such as a TextEdit().

func CloseCurrentPopup

func CloseCurrentPopup()

CloseCurrentPopup closes the popup we have begin-ed into. Clicking on a MenuItem or Selectable automatically close the current popup.

func CollapsingHeader

func CollapsingHeader(label string) bool

CollapsingHeader calls CollapsingHeaderV(label, 0).

func CollapsingHeaderV

func CollapsingHeaderV(label string, flags TreeNodeFlags) bool

CollapsingHeaderV adds a collapsing header with TreeNode flags.

func ColorButton

func ColorButton(id string, col Vec4, flags ColorEditFlags, size Vec2) bool

ColorButton displays a color square/button, hover for details, returns true when pressed.

func ColorEdit3

func ColorEdit3(label string, col *[3]float32) bool

ColorEdit3 calls ColorEdit3V(label, col, 0).

func ColorEdit3V

func ColorEdit3V(label string, col *[3]float32, flags ColorEditFlags) bool

ColorEdit3V will show a clickable little square which will open a color picker window for 3D vector (rgb format).

func ColorEdit4

func ColorEdit4(label string, col *[4]float32) bool

ColorEdit4 calls ColorEdit4V(label, col, 0).

func ColorEdit4V

func ColorEdit4V(label string, col *[4]float32, flags ColorEditFlags) bool

ColorEdit4V will show a clickable little square which will open a color picker window for 4D vector (rgba format).

func ColorPicker3

func ColorPicker3(label string, col *[3]float32) bool

ColorPicker3 calls ColorPicker3V(label, col, 0).

func ColorPicker3V

func ColorPicker3V(label string, col *[3]float32, flags ColorPickerFlags) bool

ColorPicker3V will show directly a color picker control for editing a color in 3D vector (rgb format).

func ColorPicker4

func ColorPicker4(label string, col *[4]float32) bool

ColorPicker4 calls ColorPicker4V(label, col, 0).

func ColorPicker4V

func ColorPicker4V(label string, col *[4]float32, flags ColorPickerFlags) bool

ColorPicker4V will show directly a color picker control for editing a color in 4D vector (rgba format).

func ColumnIndex

func ColumnIndex() int

ColumnIndex get current column index.

func ColumnOffset

func ColumnOffset() float32

ColumnOffset calls ColumnOffsetV(-1).

func ColumnOffsetV

func ColumnOffsetV(index int) float32

ColumnOffsetV get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0.

func ColumnWidth

func ColumnWidth() int

ColumnWidth calls ColumnWidthV(-1).

func ColumnWidthV

func ColumnWidthV(index int) int

ColumnWidthV get column width (in pixels). pass -1 to use current column.

func Columns

func Columns()

Columns API is Legacy (2021: prefer using Tables!). - You can also use SameLineV(pos_x, 0) to mimic simplified columns.

Columns calls ColumnsV(1, "", false).

func ColumnsCount

func ColumnsCount() int

ColumnsCount returns number of current columns.

func ColumnsV

func ColumnsV(count int, label string, border bool)

ColumnsV creates a column layout of the specified number of columns.

func Combo

func Combo(id string, value *int32, list []string) bool

Combo calls ComboV(id, value, list, -1).

func ComboV

func ComboV(id string, value *int32, list []string, heightInItems int) bool

ComboV is a helper over BeginCombo()/EndCombo() which are kept available for convenience purpose. This is analogous to how ListBox are created.

func CursorPosX

func CursorPosX() float32

CursorPosX returns the x-coordinate of the cursor position in window coordinates.

func CursorPosY

func CursorPosY() float32

CursorPosY returns the y-coordinate of the cursor position in window coordinates.

func DragFloat

func DragFloat(label string, value *float32) bool

DragFloat calls DragFloatV(label, value, 1.0, 0.0, 0.0, "%.3f", SliderFlagsNone).

func DragFloat2

func DragFloat2(label string, value *[2]float32) bool

DragFloat2 calls DragFloat2V(label, value, 1.0, 0.0, 0.0, "%.3f", SliderFlagsNone).

func DragFloat2V

func DragFloat2V(label string, values *[2]float32, speed, min, max float32, format string, flags SliderFlags) bool

DragFloat2V creates a draggable slider for a 2D vector.

func DragFloat3

func DragFloat3(label string, value *[3]float32) bool

DragFloat3 calls DragFloat3V(label, value, 1.0, 0.0, 0.0, "%.3f", SliderFlagsNone).

func DragFloat3V

func DragFloat3V(label string, values *[3]float32, speed, min, max float32, format string, flags SliderFlags) bool

DragFloat3V creates a draggable slider for a 3D vector.

func DragFloat4

func DragFloat4(label string, value *[4]float32) bool

DragFloat4 calls DragFloat4V(label, value, 1.0, 0.0, 0.0, "%.3f", SliderFlagsNone).

func DragFloat4V

func DragFloat4V(label string, values *[4]float32, speed, min, max float32, format string, flags SliderFlags) bool

DragFloat4V creates a draggable slider for a 4D vector.

func DragFloatRange2

func DragFloatRange2(label string, currentMin *float32, currentMax *float32) bool

DragFloatRange2 calls DragFloatRange2V(label, currentMin, currentMax, 1, 0, 0, "%.3f", "%.3f", SliderFlagsNone).

func DragFloatRange2V

func DragFloatRange2V(label string, currentMin *float32, currentMax *float32, speed float32, min float32, max float32, format string, formatMax string, flags SliderFlags) bool

DragFloatRange2V creates a draggable slider in floats range.

func DragFloatV

func DragFloatV(label string, value *float32, speed, min, max float32, format string, flags SliderFlags) bool

DragFloatV creates a draggable slider for floats.

func DragInt

func DragInt(label string, value *int32) bool

DragInt calls DragIntV(label, value, 1.0, 0, 0, "%d", SliderFlagsNone).

func DragInt2

func DragInt2(label string, value *[2]int32) bool

DragInt2 calls DragInt2V(label, value, 1.0, 0.0, 0.0, "%d", SliderFlagsNone).

func DragInt2V

func DragInt2V(label string, values *[2]int32, speed float32, min, max int32, format string, flags SliderFlags) bool

DragInt2V creates a draggable slider for a 2D vector.

func DragInt3

func DragInt3(label string, value *[3]int32) bool

DragInt3 calls DragInt3V(label, value, 1.0, 0.0, 0.0, "%d", SliderFlagsNone).

func DragInt3V

func DragInt3V(label string, values *[3]int32, speed float32, min, max int32, format string, flags SliderFlags) bool

DragInt3V creates a draggable slider for a 3D vector.

func DragInt4

func DragInt4(label string, value *[4]int32) bool

DragInt4 calls DragInt4V(label, value, 1.0, 0.0, 0.0, "%d", SliderFlagsNone).

func DragInt4V

func DragInt4V(label string, values *[4]int32, speed float32, min, max int32, format string, flags SliderFlags) bool

DragInt4V creates a draggable slider for a 4D vector.

func DragIntRange2

func DragIntRange2(label string, currentMin *int32, currentMax *int32) bool

DragIntRange2 calls DragIntRange2V(label, currentMin, currentMax, 1, 0, 0, "%d", "%d", SliderFlagsNone).

func DragIntRange2V

func DragIntRange2V(label string, currentMin *int32, currentMax *int32, speed float32, min int, max int, format string, formatMax string, flags SliderFlags) bool

DragIntRange2V creates a draggable slider in ints range.

func DragIntV

func DragIntV(label string, value *int32, speed float32, min, max int32, format string, flags SliderFlags) bool

DragIntV creates a draggable slider for integers.

func Dummy

func Dummy(size Vec2)

Dummy adds a dummy item of given size.

func End

func End()

End closes the scope for the previously opened window. Every call to Begin() must be matched with a call to End().

func EndChild

func EndChild()

EndChild closes the scope for the previously opened child. Every call to BeginChild() must be matched with a call to EndChild().

func EndCombo

func EndCombo()

EndCombo must be called if BeginComboV() returned true.

func EndDragDropSource

func EndDragDropSource()

EndDragDropSource closes the scope for current draw and drop source. Only call EndDragDropSource() if BeginDragDropSource() returns true.

func EndDragDropTarget

func EndDragDropTarget()

EndDragDropTarget closed the scope for current drag and drop target. Only call EndDragDropTarget() if BeginDragDropTarget() returns true.

func EndFrame

func EndFrame()

EndFrame ends the ImGui frame. Automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead!

func EndGroup

func EndGroup()

EndGroup must be called for each call to BeginGroup().

func EndListBox

func EndListBox()

EndListBox closes the scope for the previously opened ListBox. only call EndListBox() if BeginListBox() returned true!

func EndMainMenuBar

func EndMainMenuBar()

EndMainMenuBar finishes a main menu bar. Only call EndMainMenuBar() if BeginMainMenuBar() returns true!

func EndMenu

func EndMenu()

EndMenu finishes a sub-menu entry. Only call EndMenu() if BeginMenu() returns true!

func EndMenuBar

func EndMenuBar()

EndMenuBar finishes a menu bar. Only call EndMenuBar() if BeginMenuBar() returns true!

func EndPopup

func EndPopup()

EndPopup finishes a popup. Only call EndPopup() if BeginPopupXXX() returns true!

func EndTabBar

func EndTabBar()

EndTabBar only call EndTabBar() if BeginTabBar() returns true!

func EndTabItem

func EndTabItem()

EndTabItem finishes a tab item. Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem().

func EndTable

func EndTable()

EndTable closes the scope for the previously opened table. only call EndTable() if BeginTable() returns true!

func EndTooltip

func EndTooltip()

EndTooltip closes the previously started tooltip window.

func FontSize

func FontSize() float32

FontSize returns the current font size (= height in pixels) of the current font with the current scale applied.

func FrameHeight

func FrameHeight() float32

FrameHeight returns the height of the current frame. This is equal to the font size plus the padding at the top and bottom.

func FrameHeightWithSpacing

func FrameHeightWithSpacing() float32

FrameHeightWithSpacing returns the height of the current frame with the item spacing added. This is equal to the font size plus the padding at the top and bottom, plus the value of style.ItemSpacing.y.

func Image

func Image(id TextureID, size Vec2)

Image calls ImageV(id, size, Vec2{0,0}, Vec2{1,1}, Vec4{1,1,1,1}, Vec4{0,0,0,0}).

func ImageButton

func ImageButton(id TextureID, size Vec2) bool

ImageButton calls ImageButtonV(id, size, Vec2{0,0}, Vec2{1,1}, -1, Vec4{0,0,0,0}, Vec4{1,1,1,1}).

func ImageButtonV

func ImageButtonV(id TextureID, size Vec2, uv0, uv1 Vec2, framePadding int, bgCol Vec4, tintCol Vec4) bool

ImageButtonV adds a button with an image, based on given texture ID. Refer to TextureID what this represents and how it is drawn. <0 framePadding uses default frame padding settings. 0 for no padding.

func ImageV

func ImageV(id TextureID, size Vec2, uv0, uv1 Vec2, tintCol, borderCol Vec4)

ImageV adds an image based on given texture ID. Refer to TextureID what this represents and how it is drawn.

func Indent

func Indent()

Indent moves content position toward the right by style.IndentSpacing.

func IndentV

func IndentV(indentW float32)

IndentV moves content position toward the right, by style.IndentSpacing or indentW if not zero.

func IndexBufferLayout

func IndexBufferLayout() (entrySize int)

IndexBufferLayout returns the byte size necessary to select fields in an index buffer of DrawList.

func InputInt

func InputInt(label string, value *int32) bool

InputInt calls InputIntV(label, value, 1, 100, 0).

func InputIntV

func InputIntV(label string, value *int32, step int, stepFast int, flags InputTextFlags) bool

InputIntV creates a input field for integer type.

func InputText

func InputText(label string, text *string) bool

InputText calls InputTextV(label, text, 0, nil).

func InputTextMultiline

func InputTextMultiline(label string, text *string) bool

InputTextMultiline calls InputTextMultilineV(label, text, Vec2{0,0}, 0, nil).

func InputTextMultilineV

func InputTextMultilineV(label string, text *string, size Vec2, flags InputTextFlags, cb InputTextCallback) bool

InputTextMultilineV provides a field for dynamic text input of multiple lines.

Contrary to the original library, this wrapper does not limit the maximum number of possible characters. Dynamic resizing of the internal buffer is handled within the wrapper and the user will never be called for such requests.

The provided callback is called for any of the requested InputTextFlagsCallback* flags.

To implement a character limit, provide a callback that drops input characters when the requested length has been reached.

func InputTextV

func InputTextV(label string, text *string, flags InputTextFlags, cb InputTextCallback) bool

InputTextV creates a text field for dynamic text input.

Contrary to the original library, this wrapper does not limit the maximum number of possible characters. Dynamic resizing of the internal buffer is handled within the wrapper and the user will never be called for such requests.

The provided callback is called for any of the requested InputTextFlagsCallback* flags.

To implement a character limit, provide a callback that drops input characters when the requested length has been reached.

func InputTextWithHint

func InputTextWithHint(label string, hint string, text *string) bool

InputTextWithHint calls InputTextWithHintV(label, hint, text, 0, nil).

func InputTextWithHintV

func InputTextWithHintV(label string, hint string, text *string, flags InputTextFlags, cb InputTextCallback) bool

InputTextWithHintV creates a text field for dynamic text input with a hint.

Contrary to the original library, this wrapper does not limit the maximum number of possible characters. Dynamic resizing of the internal buffer is handled within the wrapper and the user will never be called for such requests.

The provided callback is called for any of the requested InputTextFlagsCallback* flags.

To implement a character limit, provide a callback that drops input characters when the requested length has been reached.

func InvisibleButton

func InvisibleButton(id string, size Vec2) bool

InvisibleButton calls InvisibleButtonV(id, size, ButtonFlagsNone).

func InvisibleButtonV

func InvisibleButtonV(id string, size Vec2, flags ButtonFlags) bool

InvisibleButtonV returns true if it is clicked.

func IsAnyItemActive

func IsAnyItemActive() bool

IsAnyItemActive returns true if the any item is active.

func IsAnyItemFocused

func IsAnyItemFocused() bool

IsAnyItemFocused returns true if any item is focused.

func IsAnyMouseDown

func IsAnyMouseDown() bool

IsAnyMouseDown returns true if any mouse button is currently being held down.

func IsItemActivated

func IsItemActivated() bool

IsItemActivated returns true if the last item was made active (item was previously inactive).

func IsItemActive

func IsItemActive() bool

IsItemActive returns if the last item is active. e.g. button being held, text field being edited.

This will continuously return true while holding mouse button on an item. Items that don't interact will always return false.

func IsItemClicked

func IsItemClicked() bool

IsItemClicked returns true if the current item is clicked with the left mouse button.

func IsItemDeactivated

func IsItemDeactivated() bool

IsItemDeactivated returns true if the last item was made inactive (item was previously active).

func IsItemDeactivatedAfterEdit

func IsItemDeactivatedAfterEdit() bool

IsItemDeactivatedAfterEdit returns true if the last item was made inactive and made a value change when it was active (e.g. Slider/Drag moved).

func IsItemEdited

func IsItemEdited() bool

IsItemEdited return true if the last item was modified or was pressed. This is generally the same as the "bool" return value of many widgets.

func IsItemFocused

func IsItemFocused() bool

IsItemFocused returns true if the last item is focused.

func IsItemHovered

func IsItemHovered() bool

IsItemHovered calls IsItemHoveredV(HoveredFlagsNone).

func IsItemHoveredV

func IsItemHoveredV(flags HoveredFlags) bool

IsItemHoveredV returns true if the last item is hovered. (and usable, aka not blocked by a popup, etc.). See HoveredFlags for more options.

func IsItemToggledOpen

func IsItemToggledOpen() bool

IsItemToggledOpen returns true if the last item's open was toggled open.

func IsItemVisible

func IsItemVisible() bool

IsItemVisible returns true if the last item is visible.

func IsKeyDown

func IsKeyDown(key int) bool

IsKeyDown returns true if the corresponding key is currently being held down.

func IsKeyPressed

func IsKeyPressed(key int) bool

IsKeyPressed calls IsKeyPressedV(key, true).

func IsKeyPressedV

func IsKeyPressedV(key int, repeat bool) bool

IsKeyPressedV returns true if the corresponding key was pressed (went from !Down to Down). If repeat=true and the key is being held down then the press is repeated using io.KeyRepeatDelay and KeyRepeatRate.

func IsKeyReleased

func IsKeyReleased(key int) bool

IsKeyReleased returns true if the corresponding key was released (went from Down to !Down).

func IsMouseClicked

func IsMouseClicked(button int) bool

IsMouseClicked calls IsMouseClickedV(key, false).

func IsMouseClickedV

func IsMouseClickedV(button int, repeat bool) bool

IsMouseClickedV returns true if the mouse button was clicked (0=left, 1=right, 2=middle) If repeat=true and the mouse button is being held down then the click is repeated using io.KeyRepeatDelay and KeyRepeatRate.

func IsMouseDoubleClicked

func IsMouseDoubleClicked(button int) bool

IsMouseDoubleClicked returns true if the mouse button was double-clicked (0=left, 1=right, 2=middle).

func IsMouseDown

func IsMouseDown(button int) bool

IsMouseDown returns true if the corresponding mouse button is currently being held down.

func IsMouseDragging

func IsMouseDragging(button int, threshold float64) bool

IsMouseDragging returns true if the mouse button is being dragged.

func IsMouseReleased

func IsMouseReleased(button int) bool

IsMouseReleased returns true if the mouse button was released (went from Down to !Down).

func IsPopupOpen

func IsPopupOpen(id string) bool

IsPopupOpen calls IsPopupOpenV(id, PopupFlagsNone).

func IsPopupOpenV

func IsPopupOpenV(id string, flags PopupFlags) bool

IsPopupOpenV return true if the popup is open. IsPopupOpenV(id, PopupFlagsNone): return true if the popup is open at the current BeginPopup() level of the popup stack. IsPopupOpenV(id, PopupFlagsAnyPopupID: return true if any popup is open at the current BeginPopup() level of the popup stack. IsPopupOpenV(id, PopupFlagsAnyPopup): return true if any popup is open.

func IsWindowAppearing

func IsWindowAppearing() bool

IsWindowAppearing returns whether the current window is appearing.

func IsWindowCollapsed

func IsWindowCollapsed() bool

IsWindowCollapsed returns whether the current window is collapsed.

func IsWindowFocused

func IsWindowFocused() bool

IsWindowFocused calls IsWindowFocusedV(FocusedFlagsNone).

func IsWindowFocusedV

func IsWindowFocusedV(flags FocusedFlags) bool

IsWindowFocusedV returns if current window is focused or its root/child, depending on flags. See flags for options.

func IsWindowHovered

func IsWindowHovered() bool

IsWindowHovered calls IsWindowHoveredV(HoveredFlagsNone).

func IsWindowHoveredV

func IsWindowHoveredV(flags HoveredFlags) bool

IsWindowHoveredV returns if current window is 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!

func KeyIndex

func KeyIndex(key int) int

KeyIndex returns the key index corresponding to an imgui key.

func LabelText

func LabelText(label, text string)

LabelText adds text+label aligned the same way as value+label widgets.

func LabelTextf

func LabelTextf(label, format string, v ...interface{})

LabelTextf calls LabelText(label, fmt.Sprintf(format, v...)) .

func ListBox

func ListBox(label string, currentItem *int32, items []string) bool

ListBox calls ListBoxV(label, currentItem, items, -1) The function returns true if the selection was changed. The value of currentItem will indicate the new selected item.

func ListBoxV

func ListBoxV(label string, currentItem *int32, items []string, heightItems int) bool

ListBoxV creates a list of selectables of given items with equal height, enclosed with header and footer. This version accepts a custom item height. The function returns true if the selection was changed. The value of currentItem will indicate the new selected item.

func LoadIniSettingsFromDisk

func LoadIniSettingsFromDisk(fileName string)

LoadIniSettingsFromDisk loads ini settings from disk.

func LoadIniSettingsFromMemory

func LoadIniSettingsFromMemory(data string)

LoadIniSettingsFromMemory loads ini settings from memory.

func MenuItem(label string) bool

MenuItem calls MenuItemV(label, "", false, true).

func MenuItemV(label string, shortcut string, selected bool, enabled bool) bool

MenuItemV adds a menu item with given label. Returns true if the item is selected. If selected is not nil, it will be toggled when true is returned. Shortcuts are displayed for convenience but not processed by ImGui at the moment.

func NewFrame

func NewFrame()

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

func NextColumn

func NextColumn()

NextColumn next column, defaults to current row or next row if the current row is finished.

func OpenPopup

func OpenPopup(id string)

OpenPopup calls OpenPopupV(id, 0).

func OpenPopupOnItemClick

func OpenPopupOnItemClick()

OpenPopupOnItemClick calls OpenPopupOnItemClickV("", PopupFlagsMouseButtonRight).

func OpenPopupOnItemClickV

func OpenPopupOnItemClickV(id string, flags PopupFlags)

OpenPopupOnItemClickV helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors).

func OpenPopupV

func OpenPopupV(id string, flags PopupFlags)

OpenPopupV marks popup as open (don't call every frame!). Popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).

func PlotHistogram

func PlotHistogram(label string, values []float32)

PlotHistogram draws an array of floats as a bar graph. It calls PlotHistogramV using no overlay text and automatically calculated scale and graph size.

func PlotHistogramV

func PlotHistogramV(label string, values []float32, valuesOffset int, overlayText string, scaleMin float32, scaleMax float32, graphSize Vec2)

PlotHistogramV draws an array of floats as a bar graph with additional options. valuesOffset specifies an offset into the values array at which to start drawing, wrapping around when the end of the values array is reached. overlayText specifies a string to print on top of the graph. scaleMin and scaleMax define the scale of the y axis, if either is math.MaxFloat32 that value is calculated from the input data. graphSize defines the size of the graph, if either coordinate is zero the default size for that direction is used.

func PlotLines

func PlotLines(label string, values []float32)

PlotLines draws an array of floats as a line graph. It calls PlotLinesV using no overlay text and automatically calculated scale and graph size.

func PlotLinesV

func PlotLinesV(label string, values []float32, valuesOffset int, overlayText string, scaleMin float32, scaleMax float32, graphSize Vec2)

PlotLinesV draws an array of floats as a line graph with additional options. valuesOffset specifies an offset into the values array at which to start drawing, wrapping around when the end of the values array is reached. overlayText specifies a string to print on top of the graph. scaleMin and scaleMax define the scale of the y axis, if either is math.MaxFloat32 that value is calculated from the input data. graphSize defines the size of the graph, if either coordinate is zero the default size for that direction is used.

func PopAllowKeyboardFocus

func PopAllowKeyboardFocus()

PopAllowKeyboardFocus pops most recent allow keyboard focus setting.

func PopButtonRepeat

func PopButtonRepeat()

PopButtonRepeat pops most recent button repeat setting.

func PopFont

func PopFont()

PopFont removes the previously pushed font from the stack.

func PopID

func PopID()

PopID removes the last pushed identifier from the ID stack.

func PopItemFlag

func PopItemFlag()

PopItemFlag restores flags that were changed by the previous call to PushItemFlag().

func PopItemWidth

func PopItemWidth()

PopItemWidth must be called for each call to PushItemWidth().

func PopStyleColor

func PopStyleColor()

PopStyleColor calls PopStyleColorV(1).

func PopStyleColorV

func PopStyleColorV(count int)

PopStyleColorV reverts the given amount of style color changes.

func PopStyleVar

func PopStyleVar()

PopStyleVar calls PopStyleVarV(1).

func PopStyleVarV

func PopStyleVarV(count int)

PopStyleVarV reverts the given amount of style variable changes.

func PopTextWrapPos

func PopTextWrapPos()

PopTextWrapPos resets the last pushed position.

func ProgressBar

func ProgressBar(fraction float32)

ProgressBar calls ProgressBarV(fraction, Vec2{X: -math.SmallestNonzeroFloat32, Y: 0}, "").

func ProgressBarV

func ProgressBarV(fraction float32, size Vec2, overlay string)

ProgressBarV creates a progress bar. size (for each axis) is < 0.0f: align to end, 0.0f: auto, > 0.0f: specified size.

func PushAllowKeyboardFocus

func PushAllowKeyboardFocus(allow bool)

PushAllowKeyboardFocus allow the next window to take focus of the keyboard.

func PushButtonRepeat

func PushButtonRepeat(repeat bool)

PushButtonRepeat enables button to repeat press if held.

func PushFont

func PushFont(font Font)

PushFont adds the given font on the stack. Use DefaultFont to refer to the default font.

func PushID

func PushID(id string)

PushID pushes the given identifier into the ID stack. IDs are hash of the entire stack!

func PushIDInt

func PushIDInt(id int)

PushIDInt pushes the given identifier into the ID stack. IDs are hash of the entire stack!

func PushItemFlag

func PushItemFlag(options ItemFlags, enabled bool)

PushItemFlag changes flags in the existing options for the next items until PopItemFlag() is called.

func PushItemWidth

func PushItemWidth(width float32)

PushItemWidth pushes 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 -math.SmallestNonzeroFloat32 always align width to the right side).

func PushStyleColor

func PushStyleColor(id StyleColorID, color Vec4)

PushStyleColor pushes the current style color for given ID on a stack and sets the given one. To revert to the previous color, call PopStyleColor().

func PushStyleVarFloat

func PushStyleVarFloat(id StyleVarID, value float32)

PushStyleVarFloat pushes a float value on the stack to temporarily modify a style variable.

func PushStyleVarVec2

func PushStyleVarVec2(id StyleVarID, value Vec2)

PushStyleVarVec2 pushes a Vec2 value on the stack to temporarily modify a style variable.

func PushTextWrapPos

func PushTextWrapPos()

PushTextWrapPos calls PushTextWrapPosV(0).

func PushTextWrapPosV

func PushTextWrapPosV(wrapPosX float32)

PushTextWrapPosV defines word-wrapping for Text() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrapPosX' position in window local space. Requires a matching call to PopTextWrapPos().

func RadioButton

func RadioButton(id string, active bool) bool

RadioButton returns true if it is clicked and active indicates if it is selected.

func RadioButtonInt

func RadioButtonInt(id string, v *int, button int) bool

RadioButtonInt modifies integer v. Returns true if it is selected.

The radio button will be set if v == button. Useful for groups of radio buttons. In the example below, "radio b" will be selected.

v := 1
imgui.RadioButtonInt("radio a", &v, 0)
imgui.RadioButtonInt("radio b", &v, 1)
imgui.RadioButtonInt("radio c", &v, 2)

func Render

func Render()

Render ends the ImGui frame, finalize the draw data. After this method, call RenderedDrawData to retrieve the draw commands and execute them.

func ResetMouseDragDelta

func ResetMouseDragDelta(button int)

ResetMouseDragDelta resets the drag delta.

func SameLine

func SameLine()

SameLine calls SameLineV(0, -1).

func SameLineV

func SameLineV(posX float32, spacingW float32)

SameLineV is between widgets or groups to layout them horizontally.

func SaveIniSettingsToDisk

func SaveIniSettingsToDisk(fileName string)

SaveIniSettingsToDisk saves ini settings to disk.

func SaveIniSettingsToMemory

func SaveIniSettingsToMemory() string

SaveIniSettingsToMemory saves ini settings to memory.

func ScrollMaxX

func ScrollMaxX() float32

ScrollMaxX returns the maximum horizontal scrolling amount: ContentSize.X - WindowSize.X .

func ScrollMaxY

func ScrollMaxY() float32

ScrollMaxY returns the maximum vertical scrolling amount: ContentSize.Y - WindowSize.Y .

func ScrollX

func ScrollX() float32

ScrollX returns the horizontal scrolling amount [0..GetScrollMaxX()].

func ScrollY

func ScrollY() float32

ScrollY returns the vertical scrolling amount [0..GetScrollMaxY()].

func Selectable

func Selectable(label string) bool

Selectable calls SelectableV(label, false, 0, Vec2{0, 0}).

func SelectableV

func SelectableV(label string, selected bool, flags SelectableFlags, size Vec2) bool

SelectableV returns true if the user clicked it, so you can modify your selection state. flags are the SelectableFlags to apply. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height.

func Separator

func Separator()

Separator is generally horizontal. Inside a menu bar or in horizontal layout mode, this becomes a vertical separator.

func SetAssertHandler

func SetAssertHandler(handler AssertHandler)

SetAssertHandler registers a handler function for all future assertions. Setting nil will disable special handling. The default handler panics.

func SetColumnOffset

func SetColumnOffset(index int, offsetX float32)

SetColumnOffset set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column.

func SetColumnWidth

func SetColumnWidth(index int, width float32)

SetColumnWidth sets column width (in pixels). pass -1 to use current column.

func SetCursorPos

func SetCursorPos(localPos Vec2)

SetCursorPos sets the cursor relative to the current window.

func SetCursorScreenPos

func SetCursorScreenPos(absPos Vec2)

SetCursorScreenPos sets cursor position in absolute coordinates.

func SetDragDropPayload

func SetDragDropPayload(dataType string, data []byte, cond Condition) bool

SetDragDropPayload sets the payload for current draw and drop source. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui.

func SetItemAllowOverlap

func SetItemAllowOverlap()

SetItemAllowOverlap allows last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority. This is sometimes useful with invisible buttons, selectables, etc. to catch unused area.

func SetItemDefaultFocus

func SetItemDefaultFocus()

SetItemDefaultFocus makes the last item the default focused item of a window.

func SetKeyboardFocusHere

func SetKeyboardFocusHere()

SetKeyboardFocusHere calls SetKeyboardFocusHereV(0).

func SetKeyboardFocusHereV

func SetKeyboardFocusHereV(offset int)

SetKeyboardFocusHereV gives keyboard focus to next item.

func SetMouseCursor

func SetMouseCursor(cursor MouseCursorID)

SetMouseCursor sets desired cursor type.

func SetNextItemOpen

func SetNextItemOpen(open bool, cond Condition)

SetNextItemOpen sets the open/collapsed state of the following tree node.

func SetNextItemWidth

func SetNextItemWidth(width float32)

SetNextItemWidth sets 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 -math.SmallestNonzeroFloat32 always align width to the right side).

func SetNextWindowBgAlpha

func SetNextWindowBgAlpha(value float32)

SetNextWindowBgAlpha sets next window background color alpha. Helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg.

func SetNextWindowCollapsed

func SetNextWindowCollapsed(collapsed bool, cond Condition)

SetNextWindowCollapsed sets the next window collapsed state.

func SetNextWindowContentSize

func SetNextWindowContentSize(size Vec2)

SetNextWindowContentSize sets next window content size (~ enforce the range of scrollbars). Does not include window decorations (title bar, menu bar, etc.). Set one axis to 0.0 to leave it automatic. This function must be called before Begin() to take effect.

func SetNextWindowFocus

func SetNextWindowFocus()

SetNextWindowFocus sets next window to be focused / front-most. Call before Begin().

func SetNextWindowPos

func SetNextWindowPos(pos Vec2)

SetNextWindowPos calls SetNextWindowPosV(pos, 0, Vec{0,0}).

func SetNextWindowPosV

func SetNextWindowPosV(pos Vec2, cond Condition, pivot Vec2)

SetNextWindowPosV sets next window position. Call before Begin(). Use pivot=(0.5,0.5) to center on given point, etc.

func SetNextWindowSize

func SetNextWindowSize(size Vec2)

SetNextWindowSize calls SetNextWindowSizeV(size, 0).

func SetNextWindowSizeConstraints

func SetNextWindowSizeConstraints(sizeMin Vec2, sizeMax Vec2)

SetNextWindowSizeConstraints set next window size limits. Use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints.

func SetNextWindowSizeV

func SetNextWindowSizeV(size Vec2, cond Condition)

SetNextWindowSizeV sets next window size. Set axis to 0.0 to force an auto-fit on this axis. Call before Begin().

func SetScrollHereX

func SetScrollHereX(ratio float32)

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

func SetScrollHereY

func SetScrollHereY(ratio float32)

SetScrollHereY adjusts vertical scrolling amount to make current cursor position visible. ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead.

func SetScrollX

func SetScrollX(scrollX float32)

SetScrollX sets horizontal scrolling amount [0 .. ScrollMaxX()].

func SetScrollY

func SetScrollY(scrollY float32)

SetScrollY sets vertical scrolling amount [0 .. ScrollMaxY()].

func SetTabItemClosed

func SetTabItemClosed(tabOrDockedWindowLabel string)

SetTabItemClosed notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.

func SetTooltip

func SetTooltip(text string)

SetTooltip sets a text tooltip under the mouse-cursor, typically use with IsItemHovered(). Overrides any previous call to SetTooltip().

func SetTooltipf

func SetTooltipf(format string, v ...interface{})

SetTooltipf calls SetTooltip(fmt.Sprintf(format, v...)) .

func ShowDemoWindow

func ShowDemoWindow(open *bool)

ShowDemoWindow creates a demo/test window. Demonstrates most ImGui features. Call this to learn about the library! Try to make it always available in your application!

func ShowUserGuide

func ShowUserGuide()

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

func SliderFloat

func SliderFloat(label string, value *float32, min, max float32) bool

SliderFloat calls SliderIntV(label, value, min, max, "%.3f", SliderFlagsNone).

func SliderFloat2

func SliderFloat2(label string, values *[2]float32, min, max float32) bool

SliderFloat2 calls SliderFloat2V(label, values, min, max, "%.3f", SliderFlagsNone).

func SliderFloat2V

func SliderFloat2V(label string, values *[2]float32, min, max float32, format string, flags SliderFlags) bool

SliderFloat2V creates slider for a 2D vector.

func SliderFloat3

func SliderFloat3(label string, values *[3]float32, min, max float32) bool

SliderFloat3 calls SliderFloat3V(label, values, min, max, "%.3f", SliderFlagsNone).

func SliderFloat3V

func SliderFloat3V(label string, values *[3]float32, min, max float32, format string, flags SliderFlags) bool

SliderFloat3V creates slider for a 3D vector.

func SliderFloat4

func SliderFloat4(label string, values *[4]float32, min, max float32) bool

SliderFloat4 calls SliderFloat3V(label, values, min, max, "%.3f", SliderFlagsNone).

func SliderFloat4V

func SliderFloat4V(label string, values *[4]float32, min, max float32, format string, flags SliderFlags) bool

SliderFloat4V creates slider for a 4D vector.

func SliderFloatV

func SliderFloatV(label string, value *float32, min, max float32, format string, flags SliderFlags) bool

SliderFloatV creates a slider for floats.

func SliderInt

func SliderInt(label string, value *int32, min, max int32) bool

SliderInt calls SliderIntV(label, value, min, max, "%d", SliderFlagsNone).

func SliderInt2

func SliderInt2(label string, values *[2]int32, min, max int) bool

SliderInt2 calls SliderInt2V(label, values, min, max, "%d", SliderFlagsNone).

func SliderInt2V

func SliderInt2V(label string, values *[2]int32, min, max int, format string, flags SliderFlags) bool

SliderInt2V creates slider for a 2D vector.

func SliderInt3

func SliderInt3(label string, values *[3]int32, min, max int) bool

SliderInt3 calls SliderInt3V(label, values, min, max, "%d", SliderFlagsNone).

func SliderInt3V

func SliderInt3V(label string, values *[3]int32, min, max int, format string, flags SliderFlags) bool

SliderInt3V creates slider for a 3D vector.

func SliderInt4

func SliderInt4(label string, values *[4]int32, min, max int) bool

SliderInt4 calls SliderInt4V(label, values, min, max, "%d", SliderFlagsNone).

func SliderInt4V

func SliderInt4V(label string, values *[4]int32, min, max int, format string, flags SliderFlags) bool

SliderInt4V creates slider for a 4D vector.

func SliderIntV

func SliderIntV(label string, value *int32, min, max int32, format string, flags SliderFlags) bool

SliderIntV creates a slider for integers.

func Spacing

func Spacing()

Spacing adds vertical spacing.

func StyleColorsClassic

func StyleColorsClassic()

StyleColorsClassic sets the classic style.

func StyleColorsDark

func StyleColorsDark()

StyleColorsDark sets the new, recommended style (default).

func StyleColorsLight

func StyleColorsLight()

StyleColorsLight sets the light style, best used with borders and a custom, thicker font.

func TabItemButton

func TabItemButton(label string) bool

TabItemButton calls TabItemButtonV(label, 0).

func TabItemButtonV

func TabItemButtonV(label string, flags TabItemFlags) bool

TabItemButtonV create a Tab behaving like a button. return true when clicked. cannot be selected in the tab bar.

func TableGetColumnCount

func TableGetColumnCount() int

TableGetColumnCount returns number of columns (value passed to BeginTable).

func TableGetColumnIndex

func TableGetColumnIndex() int

TableGetColumnIndex return current column index.

func TableGetColumnName

func TableGetColumnName() string

TableGetColumnName calls TableGetColumnNameV(-1).

func TableGetColumnNameV

func TableGetColumnNameV(columnN int) string

TableGetColumnNameV returns "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.

func TableGetRowIndex

func TableGetRowIndex() int

TableGetRowIndex return current row index.

func TableHeader

func TableHeader(label string)

TableHeader submits one header cell manually (rarely used).

func TableHeadersRow

func TableHeadersRow()

TableHeadersRow submits all headers cells based on data provided to TableSetupColumn() + submit context menu.

func TableNextColumn

func TableNextColumn() bool

TableNextColumn appends into the next column (or first column of next row if currently in last column) Return true when column is visible.

func TableNextRow

func TableNextRow()

TableNextRow calls TableNextRowV(0, 0.0).

func TableNextRowV

func TableNextRowV(flags TableRowFlags, minRowHeight float32)

TableNextRowV appends into the first cell of a new row.

func TableSetBgColor

func TableSetBgColor(target TableBgTarget, color Vec4)

TableSetBgColor calls TableSetBgColorV(target, color, -1).

func TableSetBgColorV

func TableSetBgColorV(target TableBgTarget, color Vec4, columnN int)

TableSetBgColorV changes the color of a cell, row, or column. See TableBgTarget flags for details.

func TableSetColumnIndex

func TableSetColumnIndex(columnN int) bool

TableSetColumnIndex appends into the specified column. Return true when column is visible.

func TableSetupColumn

func TableSetupColumn(label string)

TableSetupColumn calls TableSetupColumnV(label, 0, 0.0, 0).

func TableSetupColumnV

func TableSetupColumnV(label string, flags TableColumnFlags, initWidthOrHeight float32, userID uint)

TableSetupColumnV specify label, resizing policy, default width/weight, id, various other flags etc.

  • Use TableSetupColumn() to specify label, resizing policy, default width/weight, id, various other flags etc.
  • Use TableHeadersRow() to create a header row and automatically submit a TableHeader() for each column. Headers are required to perform: reordering, sorting, and opening the context menu. The context menu can also be made available in columns body using TableFlags_ContextMenuInBody.
  • You may manually submit headers using TableNextRow() + TableHeader() calls, but this is only useful in some advanced use cases (e.g. adding custom widgets in header row).
  • Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled.

func TableSetupScrollFreeze

func TableSetupScrollFreeze(cols int, rows int)

TableSetupScrollFreeze locks columns/rows so they stay visible when scrolled.

func Text

func Text(text string)

Text adds formatted text. See PushTextWrapPosV() or PushStyleColorV() for modifying the output. Without any modified style stack, the text is unformatted.

func TextLineHeight

func TextLineHeight() float32

TextLineHeight returns ~ FontSize.

func TextLineHeightWithSpacing

func TextLineHeightWithSpacing() float32

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

func Textf

func Textf(format string, v ...interface{})

Textf calls Text(fmt.Sprintf(format, v...) .

func Time

func Time() float64

Time returns global imgui time. Incremented by io.DeltaTime every frame.

func TreeNode

func TreeNode(label string) bool

TreeNode calls TreeNodeV(label, 0).

func TreeNodeToLabelSpacing

func TreeNodeToLabelSpacing() float32

TreeNodeToLabelSpacing returns the horizontal distance preceding label for a regular unframed TreeNode.

func TreeNodeV

func TreeNodeV(label string, flags TreeNodeFlags) bool

TreeNodeV returns true if the tree branch is to be rendered. Call TreePop() in this case.

func TreeNodef

func TreeNodef(format string, v ...interface{}) bool

TreeNodef calls TreeNode(fmt.Sprintf(format, v...)) .

func TreePop

func TreePop()

TreePop finishes a tree branch. This has to be called for a matching TreeNodeV call returning true.

func Unindent

func Unindent()

Unindent moves content position back to the left by style.IndentSpacing.

func UnindentV

func UnindentV(indentW float32)

UnindentV moves content position back to the left, by style.IndentSpacing or indentW if not zero.

func VSliderFloat

func VSliderFloat(label string, size Vec2, value *float32, min, max float32) bool

VSliderFloat calls VSliderIntV(label, size, value, min, max, "%.3f", SliderFlagsNone).

func VSliderFloatV

func VSliderFloatV(label string, size Vec2, value *float32, min, max float32, format string, flags SliderFlags) bool

VSliderFloatV creates a vertically oriented slider for floats.

func VSliderInt

func VSliderInt(label string, size Vec2, value *int32, min, max int32) bool

VSliderInt calls VSliderIntV(label, size, value, min, max, "%d", SliderFlagsNone).

func VSliderIntV

func VSliderIntV(label string, size Vec2, value *int32, min, max int32, format string, flags SliderFlags) bool

VSliderIntV creates a vertically oriented slider for integers.

func Version

func Version() string

Version returns a version string e.g. "1.23".

func VertexBufferLayout

func VertexBufferLayout() (entrySize int, posOffset int, uvOffset int, colOffset int)

VertexBufferLayout returns the byte sizes necessary to select fields in a vertex buffer of a DrawList.

func WindowContentRegionWidth

func WindowContentRegionWidth() float32

WindowContentRegionWidth returns the width of the content boundary, in window coordinates.

DEPRECATED: in v1.85, GetWindowContentRegionWidth() function has been removed. This function now returns GetWindowContentRegionMax().x - GetWindowContentRegionMin().x, as per v1.85 release notes. Please note it's not very useful in practice, and using GetContentRegionAvail().x is generally a better choice.

func WindowHeight

func WindowHeight() float32

WindowHeight returns the height of the current window.

func WindowWidth

func WindowWidth() float32

WindowWidth returns the width of the current window.

Types

type AllocatedGlyphRanges

type AllocatedGlyphRanges struct {
	GlyphRanges
}

AllocatedGlyphRanges are GlyphRanges dynamically allocated by the application. Such ranges need to be freed when they are no longer in use to avoid resource leak.

func (*AllocatedGlyphRanges) Free

func (ranges *AllocatedGlyphRanges) Free()

Free releases the underlying memory of the ranges. Call this method when the ranges are no longer in use.

type Alpha8Image

type Alpha8Image struct {
	Width, Height int
	Pixels        unsafe.Pointer
}

Alpha8Image represents a imgui backed 8-bit alpha value image.

type AssertHandler

type AssertHandler func(expression string, file string, line int)

AssertHandler is a handler for an assertion that happened in the native part of ImGui.

type AssertionError

type AssertionError struct {
	Expression string
	File       string
	Line       int
}

AssertionError is the standard error being thrown by the default handler.

func (AssertionError) Error

func (err AssertionError) Error() string

Error returns the string representation.

type BackendFlags

type BackendFlags int

BackendFlags for IO.SetBackendFlags.

const (
	// BackendFlagsNone default = 0.
	BackendFlagsNone BackendFlags = 0
	// BackendFlagsHasGamepad back-end Platform supports gamepad and currently has one connected.
	BackendFlagsHasGamepad BackendFlags = 1 << 0
	// BackendFlagsHasMouseCursors back-end Platform supports honoring GetMouseCursor() value to change the OS cursor
	// shape.
	BackendFlagsHasMouseCursors BackendFlags = 1 << 1
	// BackendFlagsHasSetMousePos back-end Platform supports io.WantSetMousePos requests to reposition the OS mouse
	// position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
	BackendFlagsHasSetMousePos BackendFlags = 1 << 2
	// BackendFlagsRendererHasVtxOffset back-end Renderer supports ImDrawCmd::VtxOffset. This enables output of large
	// meshes (64K+ vertices) while still using 16-bits indices.
	BackendFlagsRendererHasVtxOffset BackendFlags = 1 << 3
)

type ButtonFlags

type ButtonFlags int

ButtonFlags Flags for InvisibleButton().

const (
	// ButtonFlagsNone is no flag applied.
	ButtonFlagsNone ButtonFlags = 0
	// ButtonFlagsMouseButtonLeft reacts on left mouse button (default).
	ButtonFlagsMouseButtonLeft ButtonFlags = 1 << 0
	// ButtonFlagsMouseButtonRight reacts on right mouse button.
	ButtonFlagsMouseButtonRight ButtonFlags = 1 << 1
	// ButtonFlagsMouseButtonMiddle reacts on center mouse button.
	ButtonFlagsMouseButtonMiddle ButtonFlags = 1 << 2
)

type Clipboard

type Clipboard interface {
	// Text returns the current text from the clipboard, if available.
	Text() (string, error)
	// SetText sets the text as the current text on the clipboard.
	SetText(value string)
}

Clipboard describes the access to the text clipboard of the window manager.

type ColorEditFlags

type ColorEditFlags int

ColorEditFlags for ColorEdit3V(), etc.

const (
	// ColorEditFlagsNone default = 0.
	ColorEditFlagsNone ColorEditFlags = 0
	// ColorEditFlagsNoAlpha ignores Alpha component (read 3 components from the input pointer).
	ColorEditFlagsNoAlpha ColorEditFlags = 1 << 1
	// ColorEditFlagsNoPicker disables picker when clicking on colored square.
	ColorEditFlagsNoPicker ColorEditFlags = 1 << 2
	// ColorEditFlagsNoOptions disables toggling options menu when right-clicking on inputs/small preview.
	ColorEditFlagsNoOptions ColorEditFlags = 1 << 3
	// ColorEditFlagsNoSmallPreview disables colored square preview next to the inputs. (e.g. to show only the inputs).
	ColorEditFlagsNoSmallPreview ColorEditFlags = 1 << 4
	// ColorEditFlagsNoInputs disables inputs sliders/text widgets (e.g. to show only the small preview colored square).
	ColorEditFlagsNoInputs ColorEditFlags = 1 << 5
	// ColorEditFlagsNoTooltip disables tooltip when hovering the preview.
	ColorEditFlagsNoTooltip ColorEditFlags = 1 << 6
	// ColorEditFlagsNoLabel disables display of inline text label (the label is still forwarded to the tooltip and picker).
	ColorEditFlagsNoLabel ColorEditFlags = 1 << 7
	// ColorEditFlagsNoSidePreview disables bigger color preview on right side of the picker, use small colored square preview instead.
	ColorEditFlagsNoSidePreview ColorEditFlags = 1 << 8
	// ColorEditFlagsNoDragDrop disables drag and drop target. ColorButton: disable drag and drop source.
	ColorEditFlagsNoDragDrop ColorEditFlags = 1 << 9
	// ColorEditFlagsNoBorder disables border (which is enforced by default).
	ColorEditFlagsNoBorder ColorEditFlags = 1 << 10

	// ColorEditFlagsAlphaBar shows vertical alpha bar/gradient in picker.
	ColorEditFlagsAlphaBar ColorEditFlags = 1 << 16
	// ColorEditFlagsAlphaPreview displays preview as a transparent color over a checkerboard, instead of opaque.
	ColorEditFlagsAlphaPreview ColorEditFlags = 1 << 17
	// ColorEditFlagsAlphaPreviewHalf displays half opaque / half checkerboard, instead of opaque.
	ColorEditFlagsAlphaPreviewHalf ColorEditFlags = 1 << 18
	// ColorEditFlagsHDR = (WIP) surrently only disable 0.0f..1.0f limits in RGBA edition.
	// Note: you probably want to use ImGuiColorEditFlags_Float flag as well.
	ColorEditFlagsHDR ColorEditFlags = 1 << 19
	// ColorEditFlagsRGB sets the format as RGB.
	ColorEditFlagsRGB ColorEditFlags = 1 << 20
	// ColorEditFlagsHSV sets the format as HSV.
	ColorEditFlagsHSV ColorEditFlags = 1 << 21
	// ColorEditFlagsHEX sets the format as HEX.
	ColorEditFlagsHEX ColorEditFlags = 1 << 22
	// ColorEditFlagsUint8 _display_ values formatted as 0..255.
	ColorEditFlagsUint8 ColorEditFlags = 1 << 23
	// ColorEditFlagsFloat _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
	ColorEditFlagsFloat ColorEditFlags = 1 << 24

	// ColorEditFlagsPickerHueBar shows bar for Hue, rectangle for Sat/Value.
	ColorEditFlagsPickerHueBar ColorEditFlags = 1 << 25
	// ColorEditFlagsPickerHueWheel shows wheel for Hue, triangle for Sat/Value.
	ColorEditFlagsPickerHueWheel ColorEditFlags = 1 << 26
	// ColorEditFlagsInputRGB enables input and output data in RGB format.
	ColorEditFlagsInputRGB ColorEditFlags = 1 << 27
	// ColorEditFlagsInputHSV enables input and output data in HSV format.
	ColorEditFlagsInputHSV ColorEditFlags = 1 << 28
)

type ColorPickerFlags

type ColorPickerFlags int

ColorPickerFlags for ColorPicker3V(), etc.

const (
	// ColorPickerFlagsNone default = 0.
	ColorPickerFlagsNone ColorPickerFlags = 0
	// ColorPickerFlagsNoPicker disables picker when clicking on colored square.
	ColorPickerFlagsNoPicker ColorPickerFlags = 1 << 2
	// ColorPickerFlagsNoOptions disables toggling options menu when right-clicking on inputs/small preview.
	ColorPickerFlagsNoOptions ColorPickerFlags = 1 << 3
	// ColorPickerFlagsNoAlpha ignoreс Alpha component (read 3 components from the input pointer).
	ColorPickerFlagsNoAlpha ColorPickerFlags = 1 << 1
	// ColorPickerFlagsNoSmallPreview disables colored square preview next to the inputs. (e.g. to show only the inputs).
	ColorPickerFlagsNoSmallPreview ColorPickerFlags = 1 << 4
	// ColorPickerFlagsNoInputs disables inputs sliders/text widgets (e.g. to show only the small preview colored square).
	ColorPickerFlagsNoInputs ColorPickerFlags = 1 << 5
	// ColorPickerFlagsNoTooltip disables tooltip when hovering the preview.
	ColorPickerFlagsNoTooltip ColorPickerFlags = 1 << 6
	// ColorPickerFlagsNoLabel disables display of inline text label (the label is still forwarded to the tooltip and picker).
	ColorPickerFlagsNoLabel ColorPickerFlags = 1 << 7
	// ColorPickerFlagsNoSidePreview disables bigger color preview on right side of the picker, use small colored square preview instead.
	ColorPickerFlagsNoSidePreview ColorPickerFlags = 1 << 8

	// ColorPickerFlagsAlphaBar shows vertical alpha bar/gradient in picker.
	ColorPickerFlagsAlphaBar ColorPickerFlags = 1 << 16
	// ColorPickerFlagsAlphaPreview displays preview as a transparent color over a checkerboard, instead of opaque.
	ColorPickerFlagsAlphaPreview ColorPickerFlags = 1 << 17
	// ColorPickerFlagsAlphaPreviewHalf displays half opaque / half checkerboard, instead of opaque.
	ColorPickerFlagsAlphaPreviewHalf ColorPickerFlags = 1 << 18
	// ColorPickerFlagsRGB sets the format as RGB.
	ColorPickerFlagsRGB ColorPickerFlags = 1 << 20
	// ColorPickerFlagsHSV sets the format as HSV.
	ColorPickerFlagsHSV ColorPickerFlags = 1 << 21
	// ColorPickerFlagsHEX sets the format as HEX.
	ColorPickerFlagsHEX ColorPickerFlags = 1 << 22
	// ColorPickerFlagsUint8 _display_ values formatted as 0..255.
	ColorPickerFlagsUint8 ColorPickerFlags = 1 << 23
	// ColorPickerFlagsFloat _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
	ColorPickerFlagsFloat ColorPickerFlags = 1 << 24
	// ColorPickerFlagsPickerHueBar bar for Hue, rectangle for Sat/Value.
	ColorPickerFlagsPickerHueBar ColorPickerFlags = 1 << 25
	// ColorPickerFlagsPickerHueWheel wheel for Hue, triangle for Sat/Value.
	ColorPickerFlagsPickerHueWheel ColorPickerFlags = 1 << 26
	// ColorPickerFlagsInputRGB enables input and output data in RGB format.
	ColorPickerFlagsInputRGB ColorPickerFlags = 1 << 27
	// ColorPickerFlagsInputHSV enables input and output data in HSV format.
	ColorPickerFlagsInputHSV ColorPickerFlags = 1 << 28
)

type ComboFlags

type ComboFlags int

ComboFlags for BeginComboV().

const (
	// ComboFlagsNone default = 0.
	ComboFlagsNone ComboFlags = 0
	// ComboFlagsPopupAlignLeft aligns the popup toward the left by default.
	ComboFlagsPopupAlignLeft ComboFlags = 1 << 0
	// ComboFlagsHeightSmall has max ~4 items visible.
	// Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo().
	ComboFlagsHeightSmall ComboFlags = 1 << 1
	// ComboFlagsHeightRegular has max ~8 items visible (default).
	ComboFlagsHeightRegular ComboFlags = 1 << 2
	// ComboFlagsHeightLarge has max ~20 items visible.
	ComboFlagsHeightLarge ComboFlags = 1 << 3
	// ComboFlagsHeightLargest has as many fitting items as possible.
	ComboFlagsHeightLargest ComboFlags = 1 << 4
	// ComboFlagsNoArrowButton displays on the preview box without the square arrow button.
	ComboFlagsNoArrowButton ComboFlags = 1 << 5
	// ComboFlagsNoPreview displays only a square arrow button.
	ComboFlagsNoPreview ComboFlags = 1 << 6
)

type Condition

type Condition int

Condition for SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions. Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ConditionAlways.

const (
	// ConditionNone sets no condition (always set the variable), same as ConditionAlways.
	ConditionNone Condition = 0
	// ConditionAlways sets the variable.
	ConditionAlways Condition = 1 << 0
	// ConditionOnce sets the variable once per runtime session (only the first call with succeed).
	ConditionOnce Condition = 1 << 1
	// ConditionFirstUseEver sets the variable if the object/window has no persistently saved data (no entry in .ini file).
	ConditionFirstUseEver Condition = 1 << 2
	// ConditionAppearing sets the variable if the object/window is appearing after being hidden/inactive (or the first time).
	ConditionAppearing Condition = 1 << 3
)

type ConfigFlags

type ConfigFlags int

ConfigFlags for IO.SetConfigFlags.

const (
	// ConfigFlagsNone default = 0.
	ConfigFlagsNone ConfigFlags = 0
	// ConfigFlagsNavEnableKeyboard main keyboard navigation enable flag. NewFrame() will automatically fill
	// io.NavInputs[] based on io.KeysDown[].
	ConfigFlagsNavEnableKeyboard ConfigFlags = 1 << 0
	// ConfigFlagsNavEnableGamepad main gamepad navigation enable flag.
	// This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set
	// BackendFlagHasGamepad.
	ConfigFlagsNavEnableGamepad ConfigFlags = 1 << 1
	// ConfigFlagsNavEnableSetMousePos instruct navigation to move the mouse cursor. May be useful on TV/console systems
	// where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you
	// MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping
	// around back and forth.
	ConfigFlagsNavEnableSetMousePos ConfigFlags = 1 << 2
	// ConfigFlagsNavNoCaptureKeyboard instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive
	// is set.
	ConfigFlagsNavNoCaptureKeyboard ConfigFlags = 1 << 3
	// ConfigFlagsNoMouse instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse
	// information set by the back-end.
	ConfigFlagsNoMouse ConfigFlags = 1 << 4
	// ConfigFlagsNoMouseCursorChange instruct back-end to not alter mouse cursor shape and visibility. Use if the
	// back-end cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse
	// cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
	ConfigFlagsNoMouseCursorChange ConfigFlags = 1 << 5

	// ConfigFlagsIsSRGB application is SRGB-aware.
	ConfigFlagsIsSRGB ConfigFlags = 1 << 20
	// ConfigFlagsIsTouchScreen application is using a touch screen instead of a mouse.
	ConfigFlagsIsTouchScreen ConfigFlags = 1 << 21
)

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context specifies a scope of ImGui.

All contexts share a same FontAtlas by default. If you want different font atlas, you can create them and overwrite the CurrentIO.Fonts of an ImGui context.

func CreateContext

func CreateContext(fontAtlas *FontAtlas) *Context

CreateContext produces a new internal state scope. Passing nil for the fontAtlas creates a default font.

func CurrentContext

func CurrentContext() (*Context, error)

CurrentContext returns the currently active state scope. Returns ErrNoContext if no context is available.

func (*Context) Destroy

func (context *Context) Destroy()

Destroy removes the internal state scope. Trying to destroy an already destroyed context does nothing.

func (Context) SetCurrent

func (context Context) SetCurrent() error

SetCurrent activates this context as the currently active state scope.

type Dir

type Dir int

Dir is a cardinal direction.

const (
	DirNone  Dir = -1
	DirLeft  Dir = 0
	DirRight Dir = 1
	DirUp    Dir = 2
	DirDown  Dir = 3
)

This is the list of Dir identifier.

type DragDropFlags

type DragDropFlags int

DragDropFlags for BeginDragDropSource(), etc.

const (
	// DragDropFlagsNone specifies the default behaviour.
	DragDropFlagsNone DragDropFlags = 0
	// DragDropFlagsSourceNoPreviewTooltip hides the tooltip that is open so you can display a preview or description of the source contents.
	DragDropFlagsSourceNoPreviewTooltip DragDropFlags = 1 << 0
	// DragDropFlagsSourceNoDisableHover preserves the behaviour of IsItemHovered. By default, when dragging we clear data so that IsItemHovered() will return true, to avoid subsequent user code submitting tooltips.
	DragDropFlagsSourceNoDisableHover DragDropFlags = 1 << 1
	// DragDropFlagsSourceNoHoldToOpenOthers disables the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
	DragDropFlagsSourceNoHoldToOpenOthers DragDropFlags = 1 << 2
	// DragDropFlagsSourceAllowNullID allows items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear ecosystem and so we made it explicit.
	DragDropFlagsSourceAllowNullID DragDropFlags = 1 << 3
	// DragDropFlagsSourceExtern specifies external source (from outside of), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
	DragDropFlagsSourceExtern DragDropFlags = 1 << 4

	// DragDropFlagsAcceptBeforeDelivery makes AcceptDragDropPayload() return true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
	DragDropFlagsAcceptBeforeDelivery DragDropFlags = 1 << 10
	// DragDropFlagsAcceptNoDrawDefaultRect does not draw the default highlight rectangle when hovering over target.
	DragDropFlagsAcceptNoDrawDefaultRect DragDropFlags = 1 << 11
	// DragDropFlagsAcceptPeekOnly is for peeking ahead and inspecting the payload before delivery.
	DragDropFlagsAcceptPeekOnly = DragDropFlagsAcceptBeforeDelivery | DragDropFlagsAcceptNoDrawDefaultRect
)

type DrawCommand

type DrawCommand uintptr

DrawCommand describes one GPU call (or a callback).

func (DrawCommand) CallUserCallback

func (cmd DrawCommand) CallUserCallback(list DrawList)

CallUserCallback calls the user callback instead of rendering the vertices. ClipRect and TextureID will be set normally.

func (DrawCommand) ClipRect

func (cmd DrawCommand) ClipRect() (rect Vec4)

ClipRect defines the clipping rectangle (x1, y1, x2, y2).

func (DrawCommand) ElementCount

func (cmd DrawCommand) ElementCount() int

ElementCount is the number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee DrawList's VertexBuffer, indices in IndexBuffer.

func (DrawCommand) HasUserCallback

func (cmd DrawCommand) HasUserCallback() bool

HasUserCallback returns true if this handle command should be deferred.

func (DrawCommand) IndexOffset

func (cmd DrawCommand) IndexOffset() int

IndexOffset is the start offset in index buffer. Always equal to sum of ElemCount drawn so far.

func (DrawCommand) TextureID

func (cmd DrawCommand) TextureID() TextureID

TextureID is the user-provided texture ID. Set by user in FontAtlas.SetTextureID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.

func (DrawCommand) VertexOffset

func (cmd DrawCommand) VertexOffset() int

VertexOffset is the start offset in vertex buffer. ImGuiBackendFlags_RendererHasVtxOffset: false always 0, otherwise may be >0 to support meshes larger than 64K vertices with 16-bit indices.

type DrawCornerFlags

type DrawCornerFlags = DrawFlags

DrawCornerFlags is replaced by DrawFlags and will be removed in v5. Deprecated: Use DrawFlags.

const (
	// DrawCornerFlagsNone specifies the default behaviour.
	// Deprecated: Use DrawFlagsRoundCornersNone
	DrawCornerFlagsNone DrawCornerFlags = DrawFlagsRoundCornersNone
	// DrawCornerFlagsTopLeft draw corner in the top left.
	// Deprecated: Use DrawFlagsRoundCornersTopLeft
	DrawCornerFlagsTopLeft DrawCornerFlags = DrawFlagsRoundCornersTopLeft
	// DrawCornerFlagsTopRight draw corner in the top right.
	// Deprecated: Use DrawFlagsRoundCornersTopRight
	DrawCornerFlagsTopRight DrawCornerFlags = DrawFlagsRoundCornersTopRight
	// DrawCornerFlagsBotLeft draw corner in the bottom left.
	// Deprecated: Use DrawFlagsRoundCornersBottomLeft
	DrawCornerFlagsBotLeft DrawCornerFlags = DrawFlagsRoundCornersBottomLeft
	// DrawCornerFlagsBotRight draw corner in the bottom right.
	// Deprecated: Use DrawFlagsRoundCornersBottomRight
	DrawCornerFlagsBotRight DrawCornerFlags = DrawFlagsRoundCornersBottomRight
	// DrawCornerFlagsAll draws all corners.
	// Deprecated: Use DrawFlagsRoundCornersAll
	DrawCornerFlagsAll DrawCornerFlags = DrawFlagsRoundCornersAll
	// DrawCornerFlagsTop draw corners at the top of the area.
	// Deprecated: Use DrawFlagsRoundCornersTop
	DrawCornerFlagsTop DrawCornerFlags = DrawCornerFlagsTopLeft | DrawCornerFlagsTopRight
	// DrawCornerFlagsBot draw corners at the bottom of the area.
	// Deprecated: Use DrawFlagsRoundCornersBottom
	DrawCornerFlagsBot DrawCornerFlags = DrawCornerFlagsBotLeft | DrawCornerFlagsBotRight
	// DrawCornerFlagsLeft draw corners on the left of the area.
	// Deprecated: Use DrawFlagsRoundCornersLeft
	DrawCornerFlagsLeft DrawCornerFlags = DrawCornerFlagsTopLeft | DrawCornerFlagsBotLeft
	// DrawCornerFlagsRight draw corners on the rigth of the area.
	// Deprecated: Use DrawFlagsRoundCornersRight
	DrawCornerFlagsRight DrawCornerFlags = DrawCornerFlagsTopRight | DrawCornerFlagsBotRight
)

type DrawData

type DrawData uintptr

DrawData contains all draw data to render an ImGui frame.

func RenderedDrawData

func RenderedDrawData() DrawData

RenderedDrawData returns the created draw commands, which are valid after Render() and until the next call to NewFrame(). This is what you have to render.

func (DrawData) CommandLists

func (data DrawData) CommandLists() []DrawList

CommandLists is an array of DrawList to render. The DrawList are owned by the context and only pointed to from here.

func (DrawData) DisplayPos

func (data DrawData) DisplayPos() Vec2

DisplayPos returns the top-left position of the viewport to render. Use this as the top-left of the orthogonal projection matrix. For the main viewport this is equal to MainViewport().Pos(). Usually {0, 0} in a single-viewport application.

func (DrawData) DisplaySize

func (data DrawData) DisplaySize() Vec2

DisplaySize returns the size of the viewport to render. For the main viewport this is equal to MainViewport().Size(). Usually set by IO.SetDisplaySize().

func (DrawData) FrameBufferScale

func (data DrawData) FrameBufferScale() Vec2

FrameBufferScale returns the amount of pixels for each unit of DisplaySize(). Generally (1,1) on normal display, (2,2) on OSX with Retina display. See also IO.DisplayFrameBufferScale().

func (DrawData) ScaleClipRects

func (data DrawData) ScaleClipRects(scale Vec2)

ScaleClipRects is a helper to scale the ClipRect field of each DrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.

func (DrawData) Valid

func (data DrawData) Valid() bool

Valid indicates whether the structure is usable. It is valid only after Render() is called and before the next NewFrame() is called.

type DrawFlags

type DrawFlags int

DrawFlags for DrawList.AddRectV, etc.

const (
	// DrawFlagsNone specified the default behaviour.
	DrawFlagsNone DrawFlags = 0
	// DrawFlagsClosed for PathStroke(), AddPolyline(): specify that shape should be closed.
	DrawFlagsClosed DrawFlags = 1 << 0
	// DrawFlagsRoundCornersTopLeft for AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersTopLeft DrawFlags = 1 << 4
	// DrawFlagsRoundCornersTopRight for AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersTopRight DrawFlags = 1 << 5
	// DrawFlagsRoundCornersBottomLeft for AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersBottomLeft DrawFlags = 1 << 6
	// DrawFlagsRoundCornersBottomRight for AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersBottomRight DrawFlags = 1 << 7
	// DrawFlagsRoundCornersNone for AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding > 0.0f).
	DrawFlagsRoundCornersNone DrawFlags = 1 << 8
	// DrawFlagsRoundCornersTop for AddRect(), AddRectFilled(), PathRect(): enable rounding top corners only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersTop DrawFlags = DrawFlagsRoundCornersTopLeft | DrawFlagsRoundCornersTopRight
	// DrawFlagsRoundCornersBottom for AddRect(), AddRectFilled(), PathRect(): enable rounding bottom corners only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersBottom DrawFlags = DrawFlagsRoundCornersBottomLeft | DrawFlagsRoundCornersBottomRight
	// DrawFlagsRoundCornersLeft for AddRect(), AddRectFilled(), PathRect(): enable rounding left corners only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersLeft DrawFlags = DrawFlagsRoundCornersBottomLeft | DrawFlagsRoundCornersTopLeft
	// DrawFlagsRoundCornersRight for AddRect(), AddRectFilled(), PathRect(): enable rounding right corners only (when rounding > 0.0f, we default to all corners).
	DrawFlagsRoundCornersRight DrawFlags = DrawFlagsRoundCornersBottomRight | DrawFlagsRoundCornersTopRight
	// DrawFlagsRoundCornersAll  for AddRect(), AddRectFilled(), PathRect(): enable rounding for all corners.
	DrawFlagsRoundCornersAll DrawFlags = DrawFlagsRoundCornersTopLeft | DrawFlagsRoundCornersTopRight | DrawFlagsRoundCornersBottomLeft | DrawFlagsRoundCornersBottomRight
	// DrawFlagsRoundCornersDefault default to ALL corners if none of the RoundCornersXX flags are specified.
	DrawFlagsRoundCornersDefault DrawFlags = DrawFlagsRoundCornersAll
	// DrawFlagsRoundCornersMask is the bitmask containing the corner flags.
	DrawFlagsRoundCornersMask DrawFlags = DrawFlagsRoundCornersAll | DrawFlagsRoundCornersNone
)

type DrawList

type DrawList uintptr

DrawList is a draw-command list. This is the low-level list of polygons that ImGui functions are filling. At the end of the frame, all command lists are passed to your render function for rendering.

Each ImGui window contains its own DrawList. You can use WindowDrawList() to access the current window draw list and draw custom primitives.

You can interleave normal ImGui calls and adding primitives to the current draw list.

In single viewport mode, top-left is == MainViewport().Pos() (generally 0,0), bottom-right is == MainViewport().Pos()+Size (generally io.DisplaySize). You are totally free to apply whatever transformation matrix to want to the data (depending on the use of the transformation you may want to apply it to ClipRect as well!)

Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui functions), if you use this API a lot consider coarse culling your drawn objects.

func BackgroundDrawList

func BackgroundDrawList() DrawList

BackgroundDrawList returns the DrawList for the background behind all windows.

func ForegroundDrawList

func ForegroundDrawList() DrawList

ForegroundDrawList returns the DrawList for over all windows.

func WindowDrawList

func WindowDrawList() DrawList

WindowDrawList returns the DrawList for the current window.

func (DrawList) AddCircle

func (list DrawList) AddCircle(center Vec2, radius float32, col PackedColor)

AddCircle calls AddCircleV(center, radius, col, 0, 1.0).

func (DrawList) AddCircleFilled

func (list DrawList) AddCircleFilled(center Vec2, radius float32, col PackedColor)

AddCircleFilled calls AddCircleFilledV(center, radius, col, 0).

func (DrawList) AddCircleFilledV

func (list DrawList) AddCircleFilledV(center Vec2, radius float32, col PackedColor, numSegments int)

AddCircleFilledV adds a filled circle to the draw list. min is the upper-left corner of the rectangle, and max is the lower right corner.

func (DrawList) AddCircleV

func (list DrawList) AddCircleV(center Vec2, radius float32, col PackedColor, numSegments int, thickness float32)

AddCircleV adds a unfilled circle to the draw list. min is the upper-left corner of the rectangle, and max is the lower right corner.

func (DrawList) AddImage

func (list DrawList) AddImage(textureID TextureID, posMin Vec2, posMax Vec2)

AddImage calls AddImageV(textureId, posMin, posMax, Vec2{0,0}, Vec2{1,1}, Packed(color.White)).

func (DrawList) AddImageQuad

func (list DrawList) AddImageQuad(textureID TextureID, p1 Vec2, p2 Vec2, p3 Vec2, p4 Vec2)

AddImageQuad calls AddImageQuadV(textureID, p1, p2, p3, p4,

Vec2{X: 0, Y: 0}, Vec2{X: 1, Y: 0}, Vec2{X: 1, Y: 1}, Vec2{X: 0, Y: 1},
	Packed(color.White)).

func (DrawList) AddImageQuadV

func (list DrawList) AddImageQuadV(textureID TextureID, p1 Vec2, p2 Vec2, p3 Vec2, p4 Vec2, uv1 Vec2, uv2 Vec2, uv3 Vec2, uv4 Vec2, tintCol PackedColor)

AddImageQuadV adds an image based on given texture ID, with four UV coordinates.

func (DrawList) AddImageV

func (list DrawList) AddImageV(textureID TextureID, posMin Vec2, posMax Vec2, uvMin Vec2, uvMax Vec2, tintCol PackedColor)

AddImageV adds an image based on given texture ID.

func (DrawList) AddLine

func (list DrawList) AddLine(p1 Vec2, p2 Vec2, col PackedColor)

AddLine call AddLineV with a thickness value of 1.0.

func (DrawList) AddLineV

func (list DrawList) AddLineV(p1 Vec2, p2 Vec2, col PackedColor, thickness float32)

AddLineV adds a line to draw list, extending from point p1 to p2.

func (DrawList) AddRect

func (list DrawList) AddRect(min Vec2, max Vec2, col PackedColor)

AddRect calls AddRectV with rounding and thickness values of 1.0 and DrawCornerFlagsAll.

func (DrawList) AddRectFilled

func (list DrawList) AddRectFilled(min Vec2, max Vec2, col PackedColor)

AddRectFilled calls AddRectFilledV(min, max, col, 1.0, DrawCornerFlagsAll).

func (DrawList) AddRectFilledMultiColor

func (list DrawList) AddRectFilledMultiColor(min Vec2, max Vec2, colUpperLeft, colUpperRight, colBottomRight, colBottomLeft PackedColor)

AddRectFilledMultiColor adds a multicolor filled rectangle to the draw list. min is the upper-left corner of the rectangle, and max is the lower right corner. rectangles with dimensions of 1 pixel are not rendered properly.

func (DrawList) AddRectFilledV

func (list DrawList) AddRectFilledV(min Vec2, max Vec2, col PackedColor, rounding float32, flags DrawFlags)

AddRectFilledV adds a filled rectangle to the draw list. min is the upper-left corner of the rectangle, and max is the lower right corner. rectangles with dimensions of 1 pixel are not rendered properly.

func (DrawList) AddRectV

func (list DrawList) AddRectV(min Vec2, max Vec2, col PackedColor, rounding float32, flags DrawFlags, thickness float32)

AddRectV adds a rectangle to draw list. min is the upper-left corner of the rectangle, and max is the lower right corner. rectangles with dimensions of 1 pixel are not rendered properly.

drawCornerFlags indicate which corners of the rectangle are to be rounded.

func (DrawList) AddText

func (list DrawList) AddText(pos Vec2, col PackedColor, text string)

AddText adds a text in specified color at given position pos.

func (DrawList) AddTriangle

func (list DrawList) AddTriangle(p1 Vec2, p2 Vec2, p3 Vec2, col PackedColor)

AddTriangle calls AddTriangleV(p1, p2, p3, col, 1.0).

func (DrawList) AddTriangleFilled

func (list DrawList) AddTriangleFilled(p1 Vec2, p2 Vec2, p3 Vec2, col PackedColor)

AddTriangleFilled adds an filled triangle of points p1, p2, p3 to the draw list.

func (DrawList) AddTriangleV

func (list DrawList) AddTriangleV(p1 Vec2, p2 Vec2, p3 Vec2, col PackedColor, thickness float32)

AddTriangleV adds an unfilled triangle of points p1, p2, p3 to the draw list.

func (DrawList) Commands

func (list DrawList) Commands() []DrawCommand

Commands returns the list of draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback.

func (DrawList) IndexBuffer

func (list DrawList) IndexBuffer() (unsafe.Pointer, int)

IndexBuffer returns the handle information of the whole index buffer. Returned are the handle pointer and the total byte size. The buffer is a packed array of index entries, each consisting of an integer offset. To determine the byte size, call IndexBufferLayout.

func (DrawList) PopClipRect

func (list DrawList) PopClipRect()

PopClipRect removes the current clip rect and returns to the previous one.

func (DrawList) PushClipRect

func (list DrawList) PushClipRect(min, max Vec2)

PushClipRect performs render-level scissoring. It calls PushClipRectV(min, max, false).

func (DrawList) PushClipRectV

func (list DrawList) PushClipRectV(min, max Vec2, intersectWithCurrentClipRect bool)

PushClipRectV performs render-level scissoring.

This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level imgui.PushClipRect() to affect logic (hit-testing and widget culling).

func (DrawList) VertexBuffer

func (list DrawList) VertexBuffer() (unsafe.Pointer, int)

VertexBuffer returns the handle information of the whole vertex buffer. Returned are the handle pointer and the total byte size. The buffer is a packed array of vertex entries, each consisting of a 2D position vector, a 2D UV vector, and a 4-byte color value. To determine the byte size and offset values, call VertexBufferLayout.

type FocusedFlags

type FocusedFlags int

FocusedFlags for IsWindowFocusedV().

const (
	// FocusedFlagsNone Return true if directly over the item/window, not obstructed by another window,
	// not obstructed by an active popup or modal blocking inputs under them.
	FocusedFlagsNone FocusedFlags = 0
	// FocusedFlagsChildWindows returns true if any children of the window is focused.
	FocusedFlagsChildWindows FocusedFlags = 1 << 0
	// FocusedFlagsRootWindow tests from root window (top most parent of the current hierarchy).
	FocusedFlagsRootWindow FocusedFlags = 1 << 1
	// FocusedFlagsAnyWindow returns true if any window is focused.
	// Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this.
	// Use WantCaptureMouse instead.
	FocusedFlagsAnyWindow FocusedFlags = 1 << 2
	// FocusedFlagsNoPopupHierarchy does not consider popup hierarchy (do not treat popup emitter
	// as parent of popup) when used with FocusedFlagsChildWindows or FocusedFlagsRootWindow.
	FocusedFlagsNoPopupHierarchy FocusedFlags = 1 << 3

	FocusedFlagsRootAndChildWindows = FocusedFlagsRootWindow | FocusedFlagsChildWindows
)

This is a list of FocusedFlags combinations.

type Font

type Font uintptr

Font describes one loaded font in an atlas.

const DefaultFont Font = 0

DefaultFont can be used to refer to the default font of the current font atlas without having the actual font reference.

func (Font) FindGlyph

func (font Font) FindGlyph(ch rune) FontGlyph

FindGlyph returns the FontGlyph corresponding to the given rune.

func (Font) FontSize

func (font Font) FontSize() float32

FontSize returns the height of the given font.

type FontAtlas

type FontAtlas uintptr

FontAtlas contains runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader.

func (FontAtlas) AddFontDefault

func (atlas FontAtlas) AddFontDefault() Font

AddFontDefault adds the default font to the atlas. This is done by default if you do not call any of the AddFont* methods before retrieving the texture data.

func (FontAtlas) AddFontDefaultV

func (atlas FontAtlas) AddFontDefaultV(cfg FontConfig) Font

AddFontDefaultV adds the default font to the atlas using the specified FontConfig.

func (FontAtlas) AddFontFromFileTTF

func (atlas FontAtlas) AddFontFromFileTTF(filename string, sizePixels float32) Font

AddFontFromFileTTF calls AddFontFromFileTTFV(filename, sizePixels, DefaultFontConfig, EmptyGlyphRanges).

func (FontAtlas) AddFontFromFileTTFV

func (atlas FontAtlas) AddFontFromFileTTFV(filename string, sizePixels float32,
	config FontConfig, glyphRange GlyphRanges) Font

AddFontFromFileTTFV attempts to load a font from given TTF file.

func (FontAtlas) AddFontFromMemoryTTF

func (atlas FontAtlas) AddFontFromMemoryTTF(fontData []byte, sizePixels float32) Font

AddFontFromMemoryTTF calls AddFontFromMemoryTTFV(fontData, sizePixels, DefaultFontConfig, EmptyGlyphRanges).

func (FontAtlas) AddFontFromMemoryTTFV

func (atlas FontAtlas) AddFontFromMemoryTTFV(
	fontData []byte, sizePixels float32,
	config FontConfig,
	glyphRange GlyphRanges,
) Font

AddFontFromMemoryTTFV attempts to load a font from given TTF byte array.

func (FontAtlas) Build

func (atlas FontAtlas) Build() bool

Build pixels data. This is called automatically for you by the TextureData*** functions.

func (FontAtlas) FontBuilderFlags

func (atlas FontAtlas) FontBuilderFlags() uint

FontBuilderFlags returns shared flags (for all fonts) for custom font builder.

func (FontAtlas) GlyphRangesChineseFull

func (atlas FontAtlas) GlyphRangesChineseFull() GlyphRanges

GlyphRangesChineseFull describes Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs.

func (FontAtlas) GlyphRangesChineseSimplifiedCommon

func (atlas FontAtlas) GlyphRangesChineseSimplifiedCommon() GlyphRanges

GlyphRangesChineseSimplifiedCommon describes Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese.

func (FontAtlas) GlyphRangesCyrillic

func (atlas FontAtlas) GlyphRangesCyrillic() GlyphRanges

GlyphRangesCyrillic describes Default + about 400 Cyrillic characters.

func (FontAtlas) GlyphRangesDefault

func (atlas FontAtlas) GlyphRangesDefault() GlyphRanges

GlyphRangesDefault describes Basic Latin, Extended Latin.

func (FontAtlas) GlyphRangesJapanese

func (atlas FontAtlas) GlyphRangesJapanese() GlyphRanges

GlyphRangesJapanese describes Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs.

func (FontAtlas) GlyphRangesKorean

func (atlas FontAtlas) GlyphRangesKorean() GlyphRanges

GlyphRangesKorean describes Default + Korean characters.

func (FontAtlas) GlyphRangesThai

func (atlas FontAtlas) GlyphRangesThai() GlyphRanges

GlyphRangesThai describes Default + Thai characters.

func (FontAtlas) SetFontBuilderFlags

func (atlas FontAtlas) SetFontBuilderFlags(flags uint)

SetFontBuilderFlags sets shared flags (for all fonts) for custom font builder. THIS IS BUILD IMPLEMENTATION DEPENDENT. Per-font override is also available in FontConfig.

func (FontAtlas) SetTexDesiredWidth

func (atlas FontAtlas) SetTexDesiredWidth(value int)

SetTexDesiredWidth registers the width desired by user before building the image. Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height. Set to 0 by default, causing auto-calculation.

func (FontAtlas) SetTextureID

func (atlas FontAtlas) SetTextureID(id TextureID)

SetTextureID sets user data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the DrawCommand.

func (FontAtlas) TextureDataAlpha8

func (atlas FontAtlas) TextureDataAlpha8() *Alpha8Image

TextureDataAlpha8 returns the image in 8-bit alpha values for the font atlas. The returned image is valid as long as the font atlas is.

func (FontAtlas) TextureDataRGBA32

func (atlas FontAtlas) TextureDataRGBA32() *RGBA32Image

TextureDataRGBA32 returns the image in 32-bit RGBA values for the font atlas. The returned image is valid as long as the font atlas is.

func (FontAtlas) TextureID

func (atlas FontAtlas) TextureID() TextureID

TextureID returns the renderer-specific texture identifier for the font atlas.

type FontConfig

type FontConfig uintptr

FontConfig describes properties of a single font.

const DefaultFontConfig FontConfig = 0

DefaultFontConfig lets ImGui take default properties as per implementation. The properties of the default configuration cannot be changed using the SetXXX functions.

func NewFontConfig

func NewFontConfig() FontConfig

NewFontConfig creates a new font configuration. Delete must be called on the returned config.

func (*FontConfig) Delete

func (config *FontConfig) Delete()

Delete removes the font configuration and resets it to the DefaultFontConfig.

func (FontConfig) FontBuilderFlags

func (config FontConfig) FontBuilderFlags() uint

FontBuilderFlags returns settings for custom font builder.

func (FontConfig) SetFontBuilderFlags

func (config FontConfig) SetFontBuilderFlags(flags uint)

SetFontBuilderFlags sets settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.

func (FontConfig) SetGlyphMaxAdvanceX

func (config FontConfig) SetGlyphMaxAdvanceX(value float32)

SetGlyphMaxAdvanceX sets the maximum AdvanceX for glyphs. Set both Min/Max to enforce mono-space font.

func (FontConfig) SetGlyphMinAdvanceX

func (config FontConfig) SetGlyphMinAdvanceX(value float32)

SetGlyphMinAdvanceX sets the minimum AdvanceX for glyphs. Set Min to align font icons, set both Min/Max to enforce mono-space font.

func (FontConfig) SetGlyphOffsetX

func (config FontConfig) SetGlyphOffsetX(value float32)

SetGlyphOffsetX sets the horizontal offset for all glyphs. Positive values adjust the glyph to the right and negative values adjust the glyph to the left.

func (FontConfig) SetGlyphOffsetY

func (config FontConfig) SetGlyphOffsetY(value float32)

SetGlyphOffsetY sets the vertical offset for all glyphs. Positive values adjust the glyph downward and negative value adjust the glyph upward.

func (FontConfig) SetMergeMode

func (config FontConfig) SetMergeMode(value bool)

SetMergeMode merges the new fonts into the previous font if enabled. This way you can combine multiple input fonts into one (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.

func (FontConfig) SetName

func (config FontConfig) SetName(name string)

SetName sets a short display name for a font, for diagnostic purposes. If the FontConfig does not provide a name, one will be synthesized for fonts which are added from files. When adding fonts from memory, this method can be used to provide a name. The name will be truncated if it is longer than the limit supported by imgui.

func (FontConfig) SetOversampleH

func (config FontConfig) SetOversampleH(value int)

SetOversampleH sets the oversampling amount for the X axis. Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.

func (FontConfig) SetOversampleV

func (config FontConfig) SetOversampleV(value int)

SetOversampleV sets the oversampling amount for the Y axis. Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.

func (FontConfig) SetPixelSnapH

func (config FontConfig) SetPixelSnapH(value bool)

SetPixelSnapH aligns every glyph to pixel boundary if enabled. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.

func (FontConfig) SetSize

func (config FontConfig) SetSize(sizePixels float32)

SetSize sets the size in pixels for rasterizer (more or less maps to the resulting font height).

type FontGlyph

type FontGlyph uintptr

FontGlyph represents a single font glyph from a font atlas.

func (FontGlyph) AdvanceX

func (glyph FontGlyph) AdvanceX() float32

AdvanceX returns the horizontal difference to the next character after the glyph is drawn.

func (FontGlyph) Codepoint

func (glyph FontGlyph) Codepoint() int

Codepoint returns the codepoint associated with the glyph.

func (FontGlyph) Colored

func (glyph FontGlyph) Colored() bool

Colored returns whether the glyph is colored.

func (FontGlyph) U0

func (glyph FontGlyph) U0() float32

U0 returns the u texture coordinate associated with the X0() vertex of the glyph.

func (FontGlyph) U1

func (glyph FontGlyph) U1() float32

U1 returns the u texture coordinate associated with the X1() vertex of the glyph.

func (FontGlyph) V0

func (glyph FontGlyph) V0() float32

V0 returns the v texture coordinate associated with the Y0() vertex of the glyph.

func (FontGlyph) V1

func (glyph FontGlyph) V1() float32

V1 returns the v texture coordinate associated with the Y1() vertex of the glyph.

func (FontGlyph) Visible

func (glyph FontGlyph) Visible() bool

Visible indicates whether the glyph is visible; it will be false for a space character, for example.

func (FontGlyph) X0

func (glyph FontGlyph) X0() float32

X0 returns the lower x coordinate of the glyph.

func (FontGlyph) X1

func (glyph FontGlyph) X1() float32

X1 returns the upper x coordinate of the glyph.

func (FontGlyph) Y0

func (glyph FontGlyph) Y0() float32

Y0 returns the lower y coordinate of the glyph.

func (FontGlyph) Y1

func (glyph FontGlyph) Y1() float32

Y1 returns the upper y coordinate of the glyph.

type GlyphRanges

type GlyphRanges uintptr

GlyphRanges describes a list of Unicode ranges; 2 value per range, values are inclusive. Standard ranges can be queried from FontAtlas.GlyphRanges*() functions.

const EmptyGlyphRanges GlyphRanges = 0

EmptyGlyphRanges is one that does not contain any ranges.

type GlyphRangesBuilder

type GlyphRangesBuilder struct {
	// contains filtered or unexported fields
}

GlyphRangesBuilder can be used to create a new, combined, set of ranges.

func (*GlyphRangesBuilder) Add

func (builder *GlyphRangesBuilder) Add(from, to rune)

Add extends the builder with the given range (inclusive). from must be smaller, or equal to, to - otherwise the range is ignored.

func (*GlyphRangesBuilder) AddExisting

func (builder *GlyphRangesBuilder) AddExisting(ranges ...GlyphRanges)

AddExisting adds the given set of ranges to the builder. The provided ranges are immediately extracted.

func (*GlyphRangesBuilder) Build

func (builder *GlyphRangesBuilder) Build() AllocatedGlyphRanges

Build combines all the currently registered ranges and creates a new instance. The returned ranges object needs to be explicitly freed in order to release resources.

type HoveredFlags

type HoveredFlags int

HoveredFlags for IsWindowHoveredV(), etc.

const (
	// HoveredFlagsNone Return true if directly over the item/window, not obstructed by another window,
	// not obstructed by an active popup or modal blocking inputs under them.
	HoveredFlagsNone HoveredFlags = 0
	// HoveredFlagsChildWindows IsWindowHovered() only: Return true if any children of the window is hovered.
	HoveredFlagsChildWindows HoveredFlags = 1 << 0
	// HoveredFlagsRootWindow IsWindowHovered() only: Test from root window (top most parent of the current hierarchy).
	HoveredFlagsRootWindow HoveredFlags = 1 << 1
	// HoveredFlagsAnyWindow IsWindowHovered() only: Return true if any window is hovered.
	HoveredFlagsAnyWindow HoveredFlags = 1 << 2
	// HoveredFlagsNoPopupHierarchy makes only IsWindowHovered() not consider popup hierarchy (do not treat popup emitter
	// as parent of popup) when used with HoveredFlagsRootWindow or HoveredFlagsRootWindow.
	HoveredFlagsNoPopupHierarchy HoveredFlags = 1 << 3
	// HoveredFlagsAllowWhenBlockedByPopup Return true even if a popup window is normally blocking access to this item/window.
	HoveredFlagsAllowWhenBlockedByPopup HoveredFlags = 1 << 5
	// HoveredFlagsAllowWhenBlockedByActiveItem Return true even if an active item is blocking access to this item/window.
	// Useful for Drag and Drop patterns.
	HoveredFlagsAllowWhenBlockedByActiveItem HoveredFlags = 1 << 7
	// HoveredFlagsAllowWhenOverlapped Return true even if the position is overlapped by another window.
	HoveredFlagsAllowWhenOverlapped HoveredFlags = 1 << 8
	// HoveredFlagsAllowWhenDisabled Return true even if the item is disabled.
	HoveredFlagsAllowWhenDisabled HoveredFlags = 1 << 9

	HoveredFlagsRectOnly            = HoveredFlagsAllowWhenBlockedByPopup | HoveredFlagsAllowWhenBlockedByActiveItem | HoveredFlagsAllowWhenOverlapped
	HoveredFlagsRootAndChildWindows = HoveredFlagsRootWindow | HoveredFlagsChildWindows
)

This is a list of HoveredFlags combinations.

type IO

type IO struct {
	// contains filtered or unexported fields
}

IO is where your app communicate with ImGui. Access via CurrentIO(). Read 'Programmer guide' section in imgui.cpp file for general usage.

func CurrentIO

func CurrentIO() IO

CurrentIO returns access to the ImGui communication struct for the currently active context.

func (IO) AddInputCharacters

func (io IO) AddInputCharacters(chars string)

AddInputCharacters adds a new character into InputCharacters[].

func (IO) AddMouseWheelDelta

func (io IO) AddMouseWheelDelta(horizontal, vertical float32)

AddMouseWheelDelta adds the given offsets to the current mouse wheel values. 1 vertical unit scrolls about 5 lines text. Most users don't have a mouse with an horizontal wheel, may not be provided by all back-ends.

func (IO) DisplayFrameBufferScale

func (io IO) DisplayFrameBufferScale() Vec2

DisplayFrameBufferScale returns scale factor for HDPI displays. It is for retina display or other situations where window coordinates are different from framebuffer coordinates.

func (IO) Fonts

func (io IO) Fonts() FontAtlas

Fonts returns the font atlas to load and assemble one or more fonts into a single tightly packed texture.

func (IO) Framerate

func (io IO) Framerate() float32

Framerate application estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames.

func (IO) GetBackendFlags

func (io IO) GetBackendFlags() BackendFlags

GetBackendFlags gets the current backend flags.

func (IO) KeyAlt

func (io IO) KeyAlt(leftAlt int, rightAlt int)

KeyAlt sets the keyboard modifier alt pressed.

func (IO) KeyAltPressed

func (io IO) KeyAltPressed() bool

KeyAltPressed get the keyboard modifier alt pressed.

func (IO) KeyCtrl

func (io IO) KeyCtrl(leftCtrl int, rightCtrl int)

KeyCtrl sets the keyboard modifier control pressed.

func (IO) KeyCtrlPressed

func (io IO) KeyCtrlPressed() bool

KeyCtrlPressed get the keyboard modifier control pressed.

func (IO) KeyMap

func (io IO) KeyMap(imguiKey int, nativeKey int)

KeyMap maps a key into the KeysDown array which represents your "native" keyboard state.

func (IO) KeyPress

func (io IO) KeyPress(key int)

KeyPress sets the KeysDown flag.

func (IO) KeyRelease

func (io IO) KeyRelease(key int)

KeyRelease clears the KeysDown flag.

func (IO) KeyShift

func (io IO) KeyShift(leftShift int, rightShift int)

KeyShift sets the keyboard modifier shift pressed.

func (IO) KeyShiftPressed

func (io IO) KeyShiftPressed() bool

KeyShiftPressed get the keyboard modifier shif pressed.

func (IO) KeySuper

func (io IO) KeySuper(leftSuper int, rightSuper int)

KeySuper sets the keyboard modifier super pressed.

func (IO) KeySuperPressed

func (io IO) KeySuperPressed() bool

KeySuperPressed get the keyboard modifier super pressed.

func (IO) MetricsActiveAllocations

func (io IO) MetricsActiveAllocations() int

MetricsActiveAllocations returns number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.

func (IO) MetricsActiveWindows

func (io IO) MetricsActiveWindows() int

MetricsActiveWindows returns number of active windows.

func (IO) MetricsRenderIndices

func (io IO) MetricsRenderIndices() int

MetricsRenderIndices returns indices output during last call to Render() = number of triangles * 3.

func (IO) MetricsRenderVertices

func (io IO) MetricsRenderVertices() int

MetricsRenderVertices returns vertices output during last call to Render().

func (IO) MetricsRenderWindows

func (io IO) MetricsRenderWindows() int

MetricsRenderWindows returns number of visible windows.

func (IO) MouseDelta

func (io IO) MouseDelta() Vec2

MouseDelta returns the mouse delta movement. Note that this is zero if either current or previous position are invalid (-math.MaxFloat32,-math.MaxFloat32), so a disappearing/reappearing mouse won't have a huge delta.

func (IO) MousePosition

func (io IO) MousePosition() Vec2

MousePosition returns the mouse position.

func (IO) MouseWheel

func (io IO) MouseWheel() (float32, float32)

MouseWheel returns the mouse wheel movement.

func (IO) SetBackendFlags

func (io IO) SetBackendFlags(flags BackendFlags)

SetBackendFlags sets back-end capabilities.

func (IO) SetClipboard

func (io IO) SetClipboard(board Clipboard)

SetClipboard registers a clipboard for text copy/paste actions. If no clipboard is set, then a fallback implementation may be used, if available for the OS. To disable clipboard handling overall, pass nil as the Clipboard.

Since ImGui queries the clipboard text via a return value, the wrapper has to hold the current clipboard text as a copy in memory. This memory will be freed at the next clipboard operation.

func (IO) SetConfigFlags

func (io IO) SetConfigFlags(flags ConfigFlags)

SetConfigFlags sets the gamepad/keyboard navigation options, etc.

func (IO) SetDeltaTime

func (io IO) SetDeltaTime(value float32)

SetDeltaTime sets the time elapsed since last frame, in seconds.

func (IO) SetDisplayFrameBufferScale

func (io IO) SetDisplayFrameBufferScale(value Vec2)

SetDisplayFrameBufferScale sets the frame buffer scale factor.

func (IO) SetDisplaySize

func (io IO) SetDisplaySize(value Vec2)

SetDisplaySize sets the size in pixels.

func (IO) SetFontGlobalScale

func (io IO) SetFontGlobalScale(value float32)

SetFontGlobalScale sets the global scaling factor for all fonts.

func (IO) SetIniFilename

func (io IO) SetIniFilename(value string)

SetIniFilename changes the filename for the settings. Default: "imgui.ini". Use an empty string to disable the ini from being used.

func (IO) SetMouseButtonDown

func (io IO) SetMouseButtonDown(index int, down bool)

SetMouseButtonDown sets whether a specific mouse button is currently pressed. Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Other buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.

func (IO) SetMouseDrawCursor

func (io IO) SetMouseDrawCursor(show bool)

SetMouseDrawCursor request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).

func (IO) SetMousePosition

func (io IO) SetMousePosition(value Vec2)

SetMousePosition sets the mouse position, in pixels. Set to Vec2(-math.MaxFloat32,-mathMaxFloat32) if mouse is unavailable (on another screen, etc.).

func (IO) WantCaptureKeyboard

func (io IO) WantCaptureKeyboard() bool

WantCaptureKeyboard returns true if imgui will use the keyboard inputs. Do not dispatch them to your main game/application (in both cases, always pass keyboard inputs to imgui).

e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.

func (IO) WantCaptureMouse

func (io IO) WantCaptureMouse() bool

WantCaptureMouse returns true if imgui will use the mouse inputs. Do not dispatch them to your main game/application in this case. In either case, always pass on mouse inputs to imgui.

e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.

func (IO) WantCaptureMouseUnlessPopupClose

func (io IO) WantCaptureMouseUnlessPopupClose() bool

WantCaptureMouseUnlessPopupClose returns true if imgui will use the mouse inputs. Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.

func (IO) WantTextInput

func (io IO) WantTextInput() bool

WantTextInput is true, you may display an on-screen keyboard. This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).

type InputTextCallback

type InputTextCallback func(InputTextCallbackData) int32

InputTextCallback is called for sharing state of an input field. By default, the callback should return 0.

type InputTextCallbackData

type InputTextCallbackData struct {
	// contains filtered or unexported fields
}

InputTextCallbackData represents the shared state of InputText(), passed as an argument to your callback.

func (InputTextCallbackData) Buffer

func (data InputTextCallbackData) Buffer() []byte

Buffer returns a view into the current UTF-8 buffer. Only during the callbacks of [Completion,History,Always] the current buffer is returned. The returned slice is a temporary view into the underlying raw buffer. Do not keep it! The underlying memory allocation may even change through a call to InsertBytes().

You may change the buffer through the following ways: If the new text has a different (encoded) length, use the functions InsertBytes() and/or DeleteBytes(). Otherwise you may keep the buffer as is and modify the bytes. If you change the buffer this way directly, mark the buffer as modified with MarkBufferModified().

func (InputTextCallbackData) CursorPos

func (data InputTextCallbackData) CursorPos() int

CursorPos returns the byte-offset of the cursor within the buffer. Only valid during [Completion,History,Always] callbacks.

func (InputTextCallbackData) DeleteBytes

func (data InputTextCallbackData) DeleteBytes(offset, count int)

DeleteBytes removes the given count of bytes starting at the specified byte offset within the buffer. This function can be called during the [Completion,History,Always] callbacks. Clears the current selection.

This function ignores the deletion beyond the current buffer length. Calling with negative offset or count arguments will panic.

func (InputTextCallbackData) EventChar

func (data InputTextCallbackData) EventChar() rune

EventChar returns the current character input. Only valid during CharFilter callback.

func (InputTextCallbackData) EventFlag

func (data InputTextCallbackData) EventFlag() InputTextFlags

EventFlag returns one of the InputTextFlagsCallback* constants to indicate the nature of the callback.

func (InputTextCallbackData) EventKey

func (data InputTextCallbackData) EventKey() int

EventKey returns the currently pressed key. Valid for completion and history callbacks.

func (InputTextCallbackData) Flags

Flags returns the set of flags that the user originally passed to InputText.

func (InputTextCallbackData) InsertBytes

func (data InputTextCallbackData) InsertBytes(offset int, bytes []byte)

InsertBytes inserts the given bytes at given byte offset into the buffer. Calling this function may change the underlying buffer allocation.

This function can be called during the [Completion,History,Always] callbacks. Clears the current selection.

Calling with an offset outside of the range of the buffer will panic.

func (InputTextCallbackData) MarkBufferModified

func (data InputTextCallbackData) MarkBufferModified()

MarkBufferModified indicates that the content of the buffer was modified during a callback. Only considered during [Completion,History,Always] callbacks.

func (InputTextCallbackData) SelectionEnd

func (data InputTextCallbackData) SelectionEnd() int

SelectionEnd returns the byte-offset of the selection end within the buffer. Only valid during [Completion,History,Always] callbacks.

func (InputTextCallbackData) SelectionStart

func (data InputTextCallbackData) SelectionStart() int

SelectionStart returns the byte-offset of the selection start within the buffer. Only valid during [Completion,History,Always] callbacks.

func (InputTextCallbackData) SetCursorPos

func (data InputTextCallbackData) SetCursorPos(value int)

SetCursorPos changes the current byte-offset of the cursor within the buffer. Only valid during [Completion,History,Always] callbacks.

func (InputTextCallbackData) SetEventChar

func (data InputTextCallbackData) SetEventChar(value rune)

SetEventChar overrides what the user entered. Set to zero do drop the current input. Returning 1 from the callback also drops the current input. Only valid during CharFilter callback.

Note: The internal representation of characters is based on uint16, so less than rune would provide.

func (InputTextCallbackData) SetSelectionEnd

func (data InputTextCallbackData) SetSelectionEnd(value int)

SetSelectionEnd changes the current byte-offset of the selection end within the buffer. Only valid during [Completion,History,Always] callbacks.

func (InputTextCallbackData) SetSelectionStart

func (data InputTextCallbackData) SetSelectionStart(value int)

SetSelectionStart changes the current byte-offset of the selection start within the buffer. Only valid during [Completion,History,Always] callbacks.

type InputTextFlags

type InputTextFlags int

InputTextFlags for InputTextV(), etc.

const (
	// InputTextFlagsNone sets everything default.
	InputTextFlagsNone InputTextFlags = 0
	// InputTextFlagsCharsDecimal allows 0123456789.+-.
	InputTextFlagsCharsDecimal InputTextFlags = 1 << 0
	// InputTextFlagsCharsHexadecimal allow 0123456789ABCDEFabcdef.
	InputTextFlagsCharsHexadecimal InputTextFlags = 1 << 1
	// InputTextFlagsCharsUppercase turns a..z into A..Z.
	InputTextFlagsCharsUppercase InputTextFlags = 1 << 2
	// InputTextFlagsCharsNoBlank filters out spaces, tabs.
	InputTextFlagsCharsNoBlank InputTextFlags = 1 << 3
	// InputTextFlagsAutoSelectAll selects entire text when first taking mouse focus.
	InputTextFlagsAutoSelectAll InputTextFlags = 1 << 4
	// InputTextFlagsEnterReturnsTrue returns 'true' when Enter is pressed (as opposed to when the value was modified).
	InputTextFlagsEnterReturnsTrue InputTextFlags = 1 << 5
	// InputTextFlagsCallbackCompletion for callback on pressing TAB (for completion handling).
	InputTextFlagsCallbackCompletion InputTextFlags = 1 << 6
	// InputTextFlagsCallbackHistory for callback on pressing Up/Down arrows (for history handling).
	InputTextFlagsCallbackHistory InputTextFlags = 1 << 7
	// InputTextFlagsCallbackAlways for callback on each iteration. User code may query cursor position, modify text buffer.
	InputTextFlagsCallbackAlways InputTextFlags = 1 << 8
	// InputTextFlagsCallbackCharFilter for callback on character inputs to replace or discard them.
	// Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
	InputTextFlagsCallbackCharFilter InputTextFlags = 1 << 9
	// InputTextFlagsAllowTabInput when pressing TAB to input a '\t' character into the text field.
	InputTextFlagsAllowTabInput InputTextFlags = 1 << 10
	// InputTextFlagsCtrlEnterForNewLine in multi-line mode, unfocus with Enter, add new line with Ctrl+Enter
	// (default is opposite: unfocus with Ctrl+Enter, add line with Enter).
	InputTextFlagsCtrlEnterForNewLine InputTextFlags = 1 << 11
	// InputTextFlagsNoHorizontalScroll disables following the cursor horizontally.
	InputTextFlagsNoHorizontalScroll InputTextFlags = 1 << 12
	// InputTextFlagsAlwaysInsertMode was renamed to InputTextFlagsAlwaysOverwriteMode to reflect its actual behavior and will be removed in v5.
	// Deprecated: Use InputTextFlagsAlwaysOverwriteMode.
	InputTextFlagsAlwaysInsertMode InputTextFlags = 1 << 13
	// InputTextFlagsAlwaysOverwriteMode sets overwrite mode.
	InputTextFlagsAlwaysOverwriteMode InputTextFlags = 1 << 13
	// InputTextFlagsReadOnly sets read-only mode.
	InputTextFlagsReadOnly InputTextFlags = 1 << 14
	// InputTextFlagsPassword sets password mode, display all characters as '*'.
	InputTextFlagsPassword InputTextFlags = 1 << 15
	// InputTextFlagsNoUndoRedo disables undo/redo. Note that input text owns the text data while active,
	// if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
	InputTextFlagsNoUndoRedo InputTextFlags = 1 << 16
	// InputTextFlagsCharsScientific allows 0123456789.+-*/eE (Scientific notation input).
	InputTextFlagsCharsScientific InputTextFlags = 1 << 17

	// ImGuiInputTextFlagsCallbackEdit for callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active).
	ImGuiInputTextFlagsCallbackEdit InputTextFlags = 1 << 19
)

type ItemFlags

type ItemFlags int

ItemFlags for PushItemFlag().

const (
	// ItemFlagsNone default = 0.
	ItemFlagsNone ItemFlags = 0
	// ItemFlagsNoTabStop has no tab stop.
	ItemFlagsNoTabStop ItemFlags = 1 << 0
	// ItemFlagsButtonRepeat will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
	ItemFlagsButtonRepeat ItemFlags = 1 << 1
	// ItemFlagsDisabled [BETA] disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211.
	ItemFlagsDisabled ItemFlags = 1 << 2
	// ItemFlagsNoNav has no nav.
	ItemFlagsNoNav ItemFlags = 1 << 3
	// ItemFlagsNoNavDefaultFocus has no nav default focus.
	ItemFlagsNoNavDefaultFocus ItemFlags = 1 << 4
	// ItemFlagsSelectableDontClosePopup automatically closes current Popup window.
	ItemFlagsSelectableDontClosePopup ItemFlags = 1 << 5
	// ItemFlagsMixedValue [BETA] represent a mixed/indeterminate value, generally multi-selection where values differ.
	// Currently only supported by Checkbox() (later should support all sorts of widgets).
	ItemFlagsMixedValue ItemFlags = 1 << 6
	// ItemFlagsDefault default = 0.
	ItemFlagsDefault ItemFlags = 0
)

type ListClipper

type ListClipper struct {
	DisplayStart int
	DisplayEnd   int

	// [Internal]
	ItemsCount  int
	StepNo      int
	ItemsFrozen int
	ItemsHeight float32
	StartPosY   float32
}

ListClipper is a helper to manually clip large list of items. If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all. The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped. (Dear ImGui already clip items based on their bounds but it needs to measure text size to do so, whereas manual coarse clipping before submission makes this cost and your own data fetching/submission cost almost null) Usage:

var clipper imgui.ListClipper
clipper.Begin(1000) // We have 1000 elements, evenly spaced.
for clipper.Step() {
    for i := clipper.DisplayStart; i < clipper.DisplayEnd; i += 1 {
        imgui.Text(fmt.Sprintf("line number %d", i))
    }
}

Generally what happens is: - Clipper lets you process the first element (DisplayStart = 0, DisplayEnd = 1) regardless of it being visible or not. - User code submit one element. - Clipper can measure the height of the first element - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element. - User code submit visible elements.

func (*ListClipper) Begin

func (clipper *ListClipper) Begin(itemsCount int)

Begin calls BeginV(itemsCount, -1.0) .

func (*ListClipper) BeginV

func (clipper *ListClipper) BeginV(itemsCount int, itemsHeight float32)

BeginV must be called before stepping. Use an itemCount of math.MaxInt if you don't know how many items you have. In this case the cursor won't be advanced in the final step.

For itemsHeight, use -1.0 to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().

func (*ListClipper) End

func (clipper *ListClipper) End()

End resets the clipper. This function is automatically called on the last call of Step() that returns false.

func (*ListClipper) Step

func (clipper *ListClipper) Step() bool

Step must be called in a loop until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.

type MouseCursorID

type MouseCursorID int

MouseCursorID for SetMouseCursor().

User code may request backend to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here.

const (
	// MouseCursorNone no mouse cursor.
	MouseCursorNone MouseCursorID = -1
	// MouseCursorArrow standard arrow mouse cursor.
	MouseCursorArrow MouseCursorID = 0
	// MouseCursorTextInput when hovering over InputText, etc.
	MouseCursorTextInput MouseCursorID = 1
	// MouseCursorResizeAll (Unused by imgui functions).
	MouseCursorResizeAll MouseCursorID = 2
	// MouseCursorResizeNS when hovering over an horizontal border.
	MouseCursorResizeNS MouseCursorID = 3
	// MouseCursorResizeEW when hovering over a vertical border or a column.
	MouseCursorResizeEW MouseCursorID = 4
	// MouseCursorResizeNESW when hovering over the bottom-left corner of a window.
	MouseCursorResizeNESW MouseCursorID = 5
	// MouseCursorResizeNWSE when hovering over the bottom-right corner of a window.
	MouseCursorResizeNWSE MouseCursorID = 6
	// MouseCursorHand (Unused by imgui functions. Use for e.g. hyperlinks).
	MouseCursorHand MouseCursorID = 7
	// MouseCursorCount is the number of defined mouse cursors.
	MouseCursorCount MouseCursorID = 8
)

func MouseCursor

func MouseCursor() MouseCursorID

MouseCursor returns desired cursor type, reset in imgui.NewFrame(), this is updated during the frame. Valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you.

type PackedColor

type PackedColor uint32

PackedColor is a 32-bit RGBA color value, with 8 bits per color channel. The bytes are assigned as 0xAABBGGRR.

func Packed

func Packed(c color.Color) PackedColor

Packed converts the given color to a PackedColor instance.

func PackedColorFromVec4

func PackedColorFromVec4(vec Vec4) PackedColor

PackedColorFromVec4 converts the given four-dimensional vector into a packed color.

func (PackedColor) RGBA

func (clr PackedColor) RGBA() (r, g, b, a uint32)

RGBA implements the color.Color interface.

type PopupFlags

type PopupFlags int

PopupFlags Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.

  • To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags. It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags.
  • For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0. IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter and want to another another flag, you need to pass in the ImGuiPopupFlags_MouseButtonRight flag.
  • Multiple buttons currently cannot be combined/or-ed in those functions (we could allow it later).
const (
	// PopupFlagsNone no popup flags apply.
	PopupFlagsNone PopupFlags = 0
	// PopupFlagsMouseButtonLeft For BeginPopupContext*(): open on Left Mouse release. Guaranteed to always be == 0 (same as ImGuiMouseButton_Left).
	PopupFlagsMouseButtonLeft PopupFlags = 0
	// PopupFlagsMouseButtonRight For BeginPopupContext*(): open on Right Mouse release. Guaranteed to always be == 1 (same as ImGuiMouseButton_Right).
	PopupFlagsMouseButtonRight PopupFlags = 1
	// PopupFlagsMouseButtonMiddle For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as ImGuiMouseButton_Middle).
	PopupFlagsMouseButtonMiddle PopupFlags = 2
	// PopupFlagsNoOpenOverExistingPopup For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack.
	PopupFlagsNoOpenOverExistingPopup PopupFlags = 1 << 5
	// PopupFlagsNoOpenOverItems For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space.
	PopupFlagsNoOpenOverItems PopupFlags = 1 << 6
	// PopupFlagsAnyPopupID For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
	PopupFlagsAnyPopupID PopupFlags = 1 << 7
	// PopupFlagsAnyPopupLevel For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level).
	PopupFlagsAnyPopupLevel PopupFlags = 1 << 8
	// PopupFlagsAnyPopup for any usage.
	PopupFlagsAnyPopup = PopupFlagsAnyPopupID | PopupFlagsAnyPopupLevel
)

type RGBA32Image

type RGBA32Image struct {
	Width, Height int
	Pixels        unsafe.Pointer
}

RGBA32Image represents a imgui backed 32-bit RGBA (8 bits per channel) value image.

type SelectableFlags

type SelectableFlags int

SelectableFlags for SelectableV().

const (
	// SelectableFlagsNone default = 0.
	SelectableFlagsNone SelectableFlags = 0
	// SelectableFlagsDontClosePopups makes clicking the selectable not close any parent popup windows.
	SelectableFlagsDontClosePopups SelectableFlags = 1 << 0
	// SelectableFlagsSpanAllColumns allows the selectable frame to span all columns (text will still fit in current column).
	SelectableFlagsSpanAllColumns SelectableFlags = 1 << 1
	// SelectableFlagsAllowDoubleClick generates press events on double clicks too.
	SelectableFlagsAllowDoubleClick SelectableFlags = 1 << 2
	// SelectableFlagsDisabled disallows selection and displays text in a greyed out color.
	SelectableFlagsDisabled SelectableFlags = 1 << 3
	// SelectableFlagsAllowItemOverlap hit testing to allow subsequent widgets to overlap this one (WIP).
	SelectableFlagsAllowItemOverlap SelectableFlags = 1 << 4
)

type SliderFlags

type SliderFlags int

SliderFlags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc. We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.

const (
	// SliderFlagsNone is no flag applied.
	SliderFlagsNone SliderFlags = 0
	// SliderFlagsAlwaysClamp clamps value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
	SliderFlagsAlwaysClamp SliderFlags = 1 << 4
	// SliderFlagsLogarithmic makes the widget logarithmic (linear otherwise). Consider using SliderFlagNoRoundToFormat with this if using a format-string with small amount of digits.
	SliderFlagsLogarithmic SliderFlags = 1 << 5
	// SliderFlagsNoRoundToFormat disables rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).
	SliderFlagsNoRoundToFormat SliderFlags = 1 << 6
	// SliderFlagsNoInput disables CTRL+Click or Enter key allowing to input text directly into the widget.
	SliderFlagsNoInput SliderFlags = 1 << 7
)

type SortDirection

type SortDirection int

SortDirection used in TableColumnSortSpecs, etc.

const (
	// SortDirectionNone no sort.
	SortDirectionNone SortDirection = 0
	// SortDirectionAscending sorts Ascending = 0->9, A->Z etc.
	SortDirectionAscending SortDirection = 1
	// SortDirectionDescending sorts Descending = 9->0, Z->A etc.
	SortDirectionDescending SortDirection = 2
)

type Style

type Style uintptr

Style describes the overall graphical representation of the user interface.

func CurrentStyle

func CurrentStyle() Style

CurrentStyle returns the UI Style for the currently active context.

func (Style) Alpha

func (style Style) Alpha() float32

Alpha returns the global alpha that applies to everything in Dear ImGui.

func (Style) AntiAliasedFill

func (style Style) AntiAliasedFill() bool

AntiAliasedFill returns the state of anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).

func (Style) AntiAliasedLines

func (style Style) AntiAliasedLines() bool

AntiAliasedLines returns the state of anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).

func (Style) AntiAliasedLinesUseTex

func (style Style) AntiAliasedLinesUseTex() bool

AntiAliasedLinesUseTex returns the state of anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering. Latched at the beginning of the frame (copied to ImDrawList).

func (Style) ButtonTextAlign

func (style Style) ButtonTextAlign() Vec2

ButtonTextAlign returns the alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).

func (Style) CellPadding

func (style Style) CellPadding() Vec2

CellPadding is the padding within a table cell.

func (Style) ChildBorderSize

func (style Style) ChildBorderSize() float32

ChildBorderSize returns the thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) ChildRounding

func (style Style) ChildRounding() float32

ChildRounding returns the radius of child window corners rounding. Set to 0.0f to have rectangular windows.

func (Style) CircleTessellationMaxError

func (style Style) CircleTessellationMaxError() float32

CircleTessellationMaxError returns the maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.

func (Style) Color

func (style Style) Color(id StyleColorID) Vec4

Color gets a color value from the UI style.

func (Style) ColorButtonPosition

func (style Style) ColorButtonPosition() Dir

ColorButtonPosition sets the side of the color button in the ColorEdit4 widget (left/right). Defaults to DirRight.

func (Style) ColumnsMinSpacing

func (style Style) ColumnsMinSpacing() float32

ColumnsMinSpacing returns the minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).

func (Style) CurveTessellationTol

func (style Style) CurveTessellationTol() float32

CurveTessellationTol returns the tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.

func (Style) DisabledAlpha

func (style Style) DisabledAlpha() float32

DisabledAlpha returns the additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.

func (Style) DisplaySafeAreaPadding

func (style Style) DisplaySafeAreaPadding() Vec2

DisplaySafeAreaPadding returns the if you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly.

func (Style) DisplayWindowPadding

func (style Style) DisplayWindowPadding() Vec2

DisplayWindowPadding returns the window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.

func (Style) FrameBorderSize

func (style Style) FrameBorderSize() float32

FrameBorderSize returns the thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) FramePadding

func (style Style) FramePadding() Vec2

FramePadding is the padding within a framed rectangle (used by most widgets).

func (Style) FrameRounding

func (style Style) FrameRounding() float32

FrameRounding returns the radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).

func (Style) GrabMinSize

func (style Style) GrabMinSize() float32

GrabMinSize returns the minimum width/height of a grab box for slider/scrollbar.

func (Style) GrabRounding

func (style Style) GrabRounding() float32

GrabRounding returns the radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.

func (Style) IndentSpacing

func (style Style) IndentSpacing() float32

IndentSpacing returns the horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).

func (Style) ItemInnerSpacing

func (style Style) ItemInnerSpacing() Vec2

ItemInnerSpacing is the horizontal and vertical spacing between elements of a composed widget (e.g. a slider and its label).

func (Style) ItemSpacing

func (style Style) ItemSpacing() Vec2

ItemSpacing returns horizontal and vertical spacing between widgets or lines.

func (Style) LogSliderDeadzone

func (style Style) LogSliderDeadzone() float32

LogSliderDeadzone returns the size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.

func (Style) MouseCursorScale

func (style Style) MouseCursorScale() float32

MouseCursorScale returns the scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.

func (Style) PopupBorderSize

func (style Style) PopupBorderSize() float32

PopupBorderSize returns the thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) PopupRounding

func (style Style) PopupRounding() float32

PopupRounding returns the radius of popup window corners rounding. (Note that tooltip windows use WindowRounding).

func (Style) ScaleAllSizes

func (style Style) ScaleAllSizes(scale float32)

ScaleAllSizes applies a scaling factor to all sizes. To scale your entire UI (e.g. if you want your app to use High DPI or generally be DPI aware) you may use this helper function. Scaling the fonts is done separately and is up to you.

Important: This operation is lossy because all sizes are rounded to integer. If you need to change your scale multiples, call this over a freshly initialized style rather than scaling multiple times.

func (Style) ScrollbarRounding

func (style Style) ScrollbarRounding() float32

ScrollbarRounding returns the radius of grab corners for scrollbar.

func (Style) ScrollbarSize

func (style Style) ScrollbarSize() float32

ScrollbarSize returns the width of the vertical scrollbar, Height of the horizontal scrollbar.

func (Style) SelectableTextAlign

func (style Style) SelectableTextAlign() Vec2

SelectableTextAlign returns the alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.

func (Style) SetAlpha

func (style Style) SetAlpha(v float32)

SetAlpha sets the global alpha that applies to everything in Dear ImGui.

func (Style) SetAntiAliasedFill

func (style Style) SetAntiAliasedFill(value bool)

SetAntiAliasedFill enables of disables anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).

func (Style) SetAntiAliasedLines

func (style Style) SetAntiAliasedLines(value bool)

SetAntiAliasedLines enables of disables anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).

func (Style) SetAntiAliasedLinesUseTex

func (style Style) SetAntiAliasedLinesUseTex(value bool)

SetAntiAliasedLinesUseTex enables of disables anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering. Latched at the beginning of the frame (copied to ImDrawList).

func (Style) SetButtonTextAlign

func (style Style) SetButtonTextAlign(value Vec2)

SetButtonTextAlign sets the alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).

func (Style) SetCellPadding

func (style Style) SetCellPadding(value Vec2)

SetCellPadding sets the padding within a table cell.

func (Style) SetChildBorderSize

func (style Style) SetChildBorderSize(v float32)

SetChildBorderSize sets the thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) SetChildRounding

func (style Style) SetChildRounding(v float32)

SetChildRounding sets the radius of child window corners rounding. Set to 0.0f to have rectangular windows.

func (Style) SetCircleTessellationMaxError

func (style Style) SetCircleTessellationMaxError(v float32)

SetCircleTessellationMaxError sets the maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.

func (Style) SetColor

func (style Style) SetColor(id StyleColorID, value Vec4)

SetColor sets a color value of the UI style.

func (Style) SetColorButtonPosition

func (style Style) SetColorButtonPosition(value Dir)

SetColorButtonPosition returns the side of the color button in the ColorEdit4 widget (left/right). Defaults to DirRight.

func (Style) SetColumnsMinSpacing

func (style Style) SetColumnsMinSpacing(v float32)

SetColumnsMinSpacing sets the minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).

func (Style) SetCurveTessellationTol

func (style Style) SetCurveTessellationTol(v float32)

SetCurveTessellationTol sets the tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.

func (Style) SetDisabledAlpha

func (style Style) SetDisabledAlpha(v float32)

SetDisabledAlpha sets the additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.

func (Style) SetDisplaySafeAreaPadding

func (style Style) SetDisplaySafeAreaPadding(value Vec2)

SetDisplaySafeAreaPadding sets the if you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly.

func (Style) SetDisplayWindowPadding

func (style Style) SetDisplayWindowPadding(value Vec2)

SetDisplayWindowPadding sets the window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.

func (Style) SetFrameBorderSize

func (style Style) SetFrameBorderSize(v float32)

SetFrameBorderSize sets the thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) SetFramePadding

func (style Style) SetFramePadding(value Vec2)

SetFramePadding sets the padding within a framed rectangle (used by most widgets).

func (Style) SetFrameRounding

func (style Style) SetFrameRounding(v float32)

SetFrameRounding sets the radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).

func (Style) SetGrabMinSize

func (style Style) SetGrabMinSize(v float32)

SetGrabMinSize sets the minimum width/height of a grab box for slider/scrollbar.

func (Style) SetGrabRounding

func (style Style) SetGrabRounding(v float32)

SetGrabRounding sets the radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.

func (Style) SetIndentSpacing

func (style Style) SetIndentSpacing(v float32)

SetIndentSpacing sets the horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).

func (Style) SetItemInnerSpacing

func (style Style) SetItemInnerSpacing(value Vec2)

SetItemInnerSpacing sets the horizontal and vertical spacing between elements of a composed widget (e.g. a slider and its label).

func (Style) SetItemSpacing

func (style Style) SetItemSpacing(value Vec2)

SetItemSpacing sets horizontal and vertical spacing between widgets or lines.

func (Style) SetLogSliderDeadzone

func (style Style) SetLogSliderDeadzone(v float32)

SetLogSliderDeadzone sets the size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.

func (Style) SetMouseCursorScale

func (style Style) SetMouseCursorScale(v float32)

SetMouseCursorScale sets the scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.

func (Style) SetPopupBorderSize

func (style Style) SetPopupBorderSize(v float32)

SetPopupBorderSize sets the thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) SetPopupRounding

func (style Style) SetPopupRounding(v float32)

SetPopupRounding sets the radius of popup window corners rounding. (Note that tooltip windows use WindowRounding).

func (Style) SetScrollbarRounding

func (style Style) SetScrollbarRounding(v float32)

SetScrollbarRounding sets the radius of grab corners for scrollbar.

func (Style) SetScrollbarSize

func (style Style) SetScrollbarSize(v float32)

SetScrollbarSize sets the width of the vertical scrollbar, Height of the horizontal scrollbar.

func (Style) SetSelectableTextAlign

func (style Style) SetSelectableTextAlign(value Vec2)

SetSelectableTextAlign sets the alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.

func (Style) SetTabBorderSize

func (style Style) SetTabBorderSize(v float32)

SetTabBorderSize sets the thickness of border around tabs.

func (Style) SetTabMinWidthForCloseButton

func (style Style) SetTabMinWidthForCloseButton(v float32)

SetTabMinWidthForCloseButton sets the minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.

func (Style) SetTabRounding

func (style Style) SetTabRounding(v float32)

SetTabRounding sets the radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.

func (Style) SetTouchExtraPadding

func (style Style) SetTouchExtraPadding(value Vec2)

SetTouchExtraPadding expand reactive bounding box for touch-based system where touch position is not accurate enough.

func (Style) SetWindowBorderSize

func (style Style) SetWindowBorderSize(v float32)

SetWindowBorderSize sets the thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) SetWindowMenuButtonPosition

func (style Style) SetWindowMenuButtonPosition(value Dir)

SetWindowMenuButtonPosition returns the side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to DirLeft.

func (Style) SetWindowMinSize

func (style Style) SetWindowMinSize(value Vec2)

SetWindowMinSize sets the minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().

func (Style) SetWindowPadding

func (style Style) SetWindowPadding(value Vec2)

SetWindowPadding sets the padding within a window.

func (Style) SetWindowRounding

func (style Style) SetWindowRounding(v float32)

SetWindowRounding sets the radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.

func (Style) SetWindowTitleAlign

func (style Style) SetWindowTitleAlign(value Vec2)

SetWindowTitleAlign sets the alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.

func (Style) TabBorderSize

func (style Style) TabBorderSize() float32

TabBorderSize returns the thickness of border around tabs.

func (Style) TabMinWidthForCloseButton

func (style Style) TabMinWidthForCloseButton() float32

TabMinWidthForCloseButton returns the minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.

func (Style) TabRounding

func (style Style) TabRounding() float32

TabRounding returns the radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.

func (Style) TouchExtraPadding

func (style Style) TouchExtraPadding() Vec2

TouchExtraPadding is the expansion for reactive bounding box for touch-based system where touch position is not accurate enough.

func (Style) WindowBorderSize

func (style Style) WindowBorderSize() float32

WindowBorderSize returns the thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).

func (Style) WindowMenuButtonPosition

func (style Style) WindowMenuButtonPosition() Dir

WindowMenuButtonPosition sets the side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to DirLeft.

func (Style) WindowMinSize

func (style Style) WindowMinSize() Vec2

WindowMinSize returns the minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().

func (Style) WindowPadding

func (style Style) WindowPadding() Vec2

WindowPadding is the padding within a window.

func (Style) WindowRounding

func (style Style) WindowRounding() float32

WindowRounding returns the radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.

func (Style) WindowTitleAlign

func (style Style) WindowTitleAlign() Vec2

WindowTitleAlign returns the alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.

type StyleColorID

type StyleColorID int

StyleColorID identifies a color in the UI style.

const (
	StyleColorText                  StyleColorID = 0
	StyleColorTextDisabled          StyleColorID = 1
	StyleColorWindowBg              StyleColorID = 2
	StyleColorChildBg               StyleColorID = 3
	StyleColorPopupBg               StyleColorID = 4
	StyleColorBorder                StyleColorID = 5
	StyleColorBorderShadow          StyleColorID = 6
	StyleColorFrameBg               StyleColorID = 7
	StyleColorFrameBgHovered        StyleColorID = 8
	StyleColorFrameBgActive         StyleColorID = 9
	StyleColorTitleBg               StyleColorID = 10
	StyleColorTitleBgActive         StyleColorID = 11
	StyleColorTitleBgCollapsed      StyleColorID = 12
	StyleColorMenuBarBg             StyleColorID = 13
	StyleColorScrollbarBg           StyleColorID = 14
	StyleColorScrollbarGrab         StyleColorID = 15
	StyleColorScrollbarGrabHovered  StyleColorID = 16
	StyleColorScrollbarGrabActive   StyleColorID = 17
	StyleColorCheckMark             StyleColorID = 18
	StyleColorSliderGrab            StyleColorID = 19
	StyleColorSliderGrabActive      StyleColorID = 20
	StyleColorButton                StyleColorID = 21
	StyleColorButtonHovered         StyleColorID = 22
	StyleColorButtonActive          StyleColorID = 23
	StyleColorHeader                StyleColorID = 24
	StyleColorHeaderHovered         StyleColorID = 25
	StyleColorHeaderActive          StyleColorID = 26
	StyleColorSeparator             StyleColorID = 27
	StyleColorSeparatorHovered      StyleColorID = 28
	StyleColorSeparatorActive       StyleColorID = 29
	StyleColorResizeGrip            StyleColorID = 30
	StyleColorResizeGripHovered     StyleColorID = 31
	StyleColorResizeGripActive      StyleColorID = 32
	StyleColorTab                   StyleColorID = 33
	StyleColorTabHovered            StyleColorID = 34
	StyleColorTabActive             StyleColorID = 35
	StyleColorTabUnfocused          StyleColorID = 36
	StyleColorTabUnfocusedActive    StyleColorID = 37
	StyleColorPlotLines             StyleColorID = 38
	StyleColorPlotLinesHovered      StyleColorID = 39
	StyleColorPlotHistogram         StyleColorID = 40
	StyleColorPlotHistogramHovered  StyleColorID = 41
	StyleColorTableHeaderBg         StyleColorID = 42 // Table header background
	StyleColorTableBorderStrong     StyleColorID = 43 // Table outer and header borders (prefer using Alpha=1.0 here)
	StyleColorTableBorderLight      StyleColorID = 44 // Table inner borders (prefer using Alpha=1.0 here)
	StyleColorTableRowBg            StyleColorID = 45 // Table row background (even rows)
	StyleColorTableRowBgAlt         StyleColorID = 46 // Table row background (odd rows)
	StyleColorTextSelectedBg        StyleColorID = 47
	StyleColorDragDropTarget        StyleColorID = 48
	StyleColorNavHighlight          StyleColorID = 49 // Gamepad/keyboard: current highlighted item
	StyleColorNavWindowingHighlight StyleColorID = 50 // Highlight window when using CTRL+TAB
	StyleColorNavWindowingDarkening StyleColorID = 51 // Darken/colorize entire screen behind the CTRL+TAB window list, when active
	StyleColorModalWindowDarkening  StyleColorID = 52 // Darken/colorize entire screen behind a modal window, when one is active
)

This is the list of StyleColor identifier.

type StyleVarID

type StyleVarID int

StyleVarID identifies a style variable in the UI style.

const (
	// StyleVarAlpha is a float.
	StyleVarAlpha StyleVarID = iota
	// StyleVarDisabledAlpha is a float.
	StyleVarDisabledAlpha
	// StyleVarWindowPadding is a Vec2.
	StyleVarWindowPadding
	// StyleVarWindowRounding is a float.
	StyleVarWindowRounding
	// StyleVarWindowBorderSize is a float.
	StyleVarWindowBorderSize
	// StyleVarWindowMinSize is a Vec2.
	StyleVarWindowMinSize
	// StyleVarWindowTitleAlign is a Vec2.
	StyleVarWindowTitleAlign
	// StyleVarChildRounding is a float.
	StyleVarChildRounding
	// StyleVarChildBorderSize is a float.
	StyleVarChildBorderSize
	// StyleVarPopupRounding is a float.
	StyleVarPopupRounding
	// StyleVarPopupBorderSize is a float.
	StyleVarPopupBorderSize
	// StyleVarFramePadding is a Vec2.
	StyleVarFramePadding
	// StyleVarFrameRounding is a float.
	StyleVarFrameRounding
	// StyleVarFrameBorderSize is a float.
	StyleVarFrameBorderSize
	// StyleVarItemSpacing is a Vec2.
	StyleVarItemSpacing
	// StyleVarItemInnerSpacing is a Vec2.
	StyleVarItemInnerSpacing
	// StyleVarIndentSpacing is a float.
	StyleVarIndentSpacing
	// StyleVarCellPadding is a Vec2.
	StyleVarCellPadding
	// StyleVarScrollbarSize is a float.
	StyleVarScrollbarSize
	// StyleVarScrollbarRounding is a float.
	StyleVarScrollbarRounding
	// StyleVarGrabMinSize is a float.
	StyleVarGrabMinSize
	// StyleVarGrabRounding is a float.
	StyleVarGrabRounding
	// StyleVarTabRounding is a float.
	StyleVarTabRounding
	// StyleVarButtonTextAlign is a Vec2.
	StyleVarButtonTextAlign
	// StyleVarSelectableTextAlign is a Vec2.
	StyleVarSelectableTextAlign
)

type TabBarFlags

type TabBarFlags int

TabBarFlags for BeginTabBarV().

const (
	// TabBarFlagsNone default = 0.
	TabBarFlagsNone TabBarFlags = 0
	// TabBarFlagsReorderable Allow manually dragging tabs to re-order them + New tabs are appended at the end of list.
	TabBarFlagsReorderable TabBarFlags = 1 << 0
	// TabBarFlagsAutoSelectNewTabs Automatically select new tabs when they appear.
	TabBarFlagsAutoSelectNewTabs TabBarFlags = 1 << 1
	// TabBarFlagsTabListPopupButton Disable buttons to open the tab list popup.
	TabBarFlagsTabListPopupButton TabBarFlags = 1 << 2
	// TabBarFlagsNoCloseWithMiddleMouseButton Disable behavior of closing tabs (that are submitted with p_open != NULL)
	// with middle mouse button. You can still repro this behavior on user's side with if
	// (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
	TabBarFlagsNoCloseWithMiddleMouseButton TabBarFlags = 1 << 3
	// TabBarFlagsNoTabListScrollingButtons Disable scrolling buttons (apply when fitting policy is
	// TabBarFlagsFittingPolicyScroll).
	TabBarFlagsNoTabListScrollingButtons TabBarFlags = 1 << 4
	// TabBarFlagsNoTooltip Disable tooltips when hovering a tab.
	TabBarFlagsNoTooltip TabBarFlags = 1 << 5
	// TabBarFlagsFittingPolicyResizeDown Resize tabs when they don't fit.
	TabBarFlagsFittingPolicyResizeDown TabBarFlags = 1 << 6
	// TabBarFlagsFittingPolicyScroll Add scroll buttons when tabs don't fit.
	TabBarFlagsFittingPolicyScroll TabBarFlags = 1 << 7
	// TabBarFlagsFittingPolicyMask combines
	// TabBarFlagsFittingPolicyResizeDown and TabBarFlagsFittingPolicyScroll.
	TabBarFlagsFittingPolicyMask = TabBarFlagsFittingPolicyResizeDown | TabBarFlagsFittingPolicyScroll
	// TabBarFlagsFittingPolicyDefault alias for TabBarFlagsFittingPolicyResizeDown.
	TabBarFlagsFittingPolicyDefault = TabBarFlagsFittingPolicyResizeDown
)

type TabItemFlags

type TabItemFlags int

TabItemFlags for BeginTabItemV(), BeginTabButtonV().

const (
	// TabItemFlagsNone default = 0.
	TabItemFlagsNone TabItemFlags = 0
	// TabItemFlagsUnsavedDocument Append '*' to title without affecting the ID, as a convenience to avoid using the
	// ### operator. Also: tab is selected on closure and closure is deferred by one frame to allow code to undo it
	// without flicker.
	TabItemFlagsUnsavedDocument TabItemFlags = 1 << 0
	// TabItemFlagsSetSelected Trigger flag to programmatically make the tab selected when calling BeginTabItem().
	TabItemFlagsSetSelected TabItemFlags = 1 << 1
	// TabItemFlagsNoCloseWithMiddleMouseButton  Disable behavior of closing tabs (that are submitted with
	// p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if
	// (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
	TabItemFlagsNoCloseWithMiddleMouseButton TabItemFlags = 1 << 2
	// TabItemFlagsNoPushID Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem().
	TabItemFlagsNoPushID TabItemFlags = 1 << 3
	// TabItemFlagsNoTooltip Disable tooltip for the given tab.
	TabItemFlagsNoTooltip TabItemFlags = 1 << 4
	// TabItemFlagsNoReorder Disable reordering this tab or having another tab cross over this tab.
	TabItemFlagsNoReorder TabItemFlags = 1 << 5
	// TabItemFlagsLeading Enforce the tab position to the left of the tab bar (after the tab list popup button).
	TabItemFlagsLeading TabItemFlags = 1 << 6
	// TabItemFlagsTrailing Enforce the tab position to the right of the tab bar (before the scrolling buttons).
	TabItemFlagsTrailing TabItemFlags = 1 << 7
)

type TableBgTarget

type TableBgTarget int

TableBgTarget for TableSetBgColor

Background colors are rendering in 3 layers:

  • Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set.
  • Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set.
  • Layer 2: draw with CellBg color if set.

The purpose of the two row/columns layers is to let you decide if a background color changes should override or blend with the existing color. When using TableFlagsRowBg on the table, each row has the RowBg0 color automatically set for odd/even rows. If you set the color of RowBg0 target, your color will override the existing RowBg0 color. If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.

const (
	// TableBgTargetNone default = 0.
	TableBgTargetNone TableBgTarget = 0
	// TableBgTargetRowBg0 sets row background color 0 (generally used for background, automatically set when TableFlagsRowBg is used).
	TableBgTargetRowBg0 TableBgTarget = 1
	// TableBgTargetRowBg1 sets row background color 1 (generally used for selection marking).
	TableBgTargetRowBg1 TableBgTarget = 2
	// TableBgTargetCellBg sets cell background color (top-most color).
	TableBgTargetCellBg TableBgTarget = 3
)

type TableColumnFlags

type TableColumnFlags int

TableColumnFlags for TableSetupColumnV().

const (

	// TableColumnFlagsNone default = 0.
	TableColumnFlagsNone TableColumnFlags = 0
	// TableColumnFlagsDisabled overrides disable flag: hide column, won't show in context menu (unlike calling TableSetColumnEnabled() which manipulates the user accessible state)
	TableColumnFlagsDisabled TableColumnFlags = 1 << 0
	// TableColumnFlagsDefaultHide Default as a hidden/disabled column.
	TableColumnFlagsDefaultHide TableColumnFlags = 1 << 1
	// TableColumnFlagsDefaultSort Default as a sorting column.
	TableColumnFlagsDefaultSort TableColumnFlags = 1 << 2
	// TableColumnFlagsWidthStretch column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp).
	TableColumnFlagsWidthStretch TableColumnFlags = 1 << 3
	// TableColumnFlagsWidthFixed column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable).
	TableColumnFlagsWidthFixed TableColumnFlags = 1 << 4
	// TableColumnFlagsNoResize disables manual resizing.
	TableColumnFlagsNoResize TableColumnFlags = 1 << 5
	// TableColumnFlagsNoReorder disables manual reordering this column, this will also prevent other columns from crossing over this column.
	TableColumnFlagsNoReorder TableColumnFlags = 1 << 6
	// TableColumnFlagsNoHide disables ability to hide/disable this column.
	TableColumnFlagsNoHide TableColumnFlags = 1 << 7
	// TableColumnFlagsNoClip disables clipping for this column (all NoClip columns will render in a same draw command).
	TableColumnFlagsNoClip TableColumnFlags = 1 << 8
	// TableColumnFlagsNoSort disables ability to sort on this field (even if TableFlagsSortable is set on the table).
	TableColumnFlagsNoSort TableColumnFlags = 1 << 9
	// TableColumnFlagsNoSortAscending disables ability to sort in the ascending direction.
	TableColumnFlagsNoSortAscending TableColumnFlags = 1 << 10
	// TableColumnFlagsNoSortDescending disables ability to sort in the descending direction.
	TableColumnFlagsNoSortDescending TableColumnFlags = 1 << 11
	// TableColumnFlagsNoHeaderLabel makes TableHeadersRow() not submit label for this column. Convenient for some small columns. Name will still appear in context menu..
	TableColumnFlagsNoHeaderLabel TableColumnFlags = 1 << 12
	// TableColumnFlagsNoHeaderWidth disables header text width contribution to automatic column width.
	TableColumnFlagsNoHeaderWidth TableColumnFlags = 1 << 13
	// TableColumnFlagsPreferSortAscending makes the initial sort direction Ascending when first sorting on this column (default).
	TableColumnFlagsPreferSortAscending TableColumnFlags = 1 << 14
	// TableColumnFlagsPreferSortDescending makes the initial sort direction Descending when first sorting on this column.
	TableColumnFlagsPreferSortDescending TableColumnFlags = 1 << 15
	// TableColumnFlagsIndentEnable uses current Indent value when entering cell (default for column 0).
	TableColumnFlagsIndentEnable TableColumnFlags = 1 << 16
	// TableColumnFlagsIndentDisable ignores current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored.
	TableColumnFlagsIndentDisable TableColumnFlags = 1 << 17

	// TableColumnFlagsIsEnabled Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags.
	TableColumnFlagsIsEnabled TableColumnFlags = 1 << 24
	// TableColumnFlagsIsVisible Status: is visible == is enabled AND not clipped by scrolling.
	TableColumnFlagsIsVisible TableColumnFlags = 1 << 25
	// TableColumnFlagsIsSorted Status: is currently part of the sort specs.
	TableColumnFlagsIsSorted TableColumnFlags = 1 << 26
	// TableColumnFlagsIsHovered Status: is hovered by mouse.
	TableColumnFlagsIsHovered TableColumnFlags = 1 << 27
)

func TableGetColumnFlags

func TableGetColumnFlags() TableColumnFlags

TableGetColumnFlags calls TableGetColumnFlagsV(-1).

func TableGetColumnFlagsV

func TableGetColumnFlagsV(columnN int) TableColumnFlags

TableGetColumnFlagsV return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.

type TableColumnSortSpecs

type TableColumnSortSpecs struct {
	ColumnUserID  uint          // User id of the column (if specified by a TableSetupColumn() call)
	ColumnIndex   int16         // Index of the column
	SortOrder     int16         // Index within parent TableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
	SortDirection SortDirection // SortDirectionAscending or SortDirectionDescending (you can use this or SortSign, whichever is more convenient for your sort function)
}

TableColumnSortSpecs is a sorting specification for one column of a table (sizeof == 12 bytes).

type TableFlags

type TableFlags int

TableFlags for BeginTableV().

const (

	// TableFlagsNone default = 0.
	TableFlagsNone TableFlags = 0
	// TableFlagsResizable enables resizing columns.
	TableFlagsResizable TableFlags = 1 << 0
	// TableFlagsReorderable enables reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers).
	TableFlagsReorderable TableFlags = 1 << 1
	// TableFlagsHideable enables hiding/disabling columns in context menu.
	TableFlagsHideable TableFlags = 1 << 2
	// TableFlagsSortable enables sorting. Call TableGetSortSpecs() to obtain sort specs. Also see TableFlagsSortMulti and TableFlagsSortTristate.
	TableFlagsSortable TableFlags = 1 << 3
	// TableFlagsNoSavedSettings disables persisting columns order, width and sort settings in the .ini file.
	TableFlagsNoSavedSettings TableFlags = 1 << 4
	// TableFlagsContextMenuInBody right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
	TableFlagsContextMenuInBody TableFlags = 1 << 5

	// TableFlagsRowBg Set each RowBg color with StyleColorTableRowBg or StyleColorTableRowBgAlt (equivalent to calling TableSetBgColor with TableBgFlagsRowBg0 on each row manually).
	TableFlagsRowBg TableFlags = 1 << 6
	// TableFlagsBordersInnerH draws horizontal borders between rows.
	TableFlagsBordersInnerH TableFlags = 1 << 7
	// TableFlagsBordersOuterH draws horizontal borders at the top and bottom.
	TableFlagsBordersOuterH TableFlags = 1 << 8
	// TableFlagsBordersInnerV draws vertical borders between columns.
	TableFlagsBordersInnerV TableFlags = 1 << 9
	// TableFlagsBordersOuterV draws vertical borders on the left and right sides.
	TableFlagsBordersOuterV TableFlags = 1 << 10
	// TableFlagsBordersH draws horizontal borders.
	TableFlagsBordersH = TableFlagsBordersInnerH | TableFlagsBordersOuterH
	// TableFlagsBordersV draws vertical borders.
	TableFlagsBordersV = TableFlagsBordersInnerV | TableFlagsBordersOuterV
	// TableFlagsBordersInner draws inner borders.
	TableFlagsBordersInner = TableFlagsBordersInnerV | TableFlagsBordersInnerH
	// TableFlagsBordersOuter draws outer borders.
	TableFlagsBordersOuter = TableFlagsBordersOuterV | TableFlagsBordersOuterH
	// TableFlagsBorders draws all borders.
	TableFlagsBorders = TableFlagsBordersInner | TableFlagsBordersOuter
	// TableFlagsNoBordersInBody [ALPHA] Disable vertical borders in columns Body (borders will always appears in Headers). -> May move to style.
	TableFlagsNoBordersInBody TableFlags = 1 << 11
	// TableFlagsNoBordersInBodyUntilResize [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers). -> May move to style.
	TableFlagsNoBordersInBodyUntilResize TableFlags = 1 << 12

	// TableFlagsSizingFixedFit columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
	TableFlagsSizingFixedFit TableFlags = 1 << 13
	// TableFlagsSizingFixedSame columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable TableFlagsNoKeepColumnsVisible.
	TableFlagsSizingFixedSame TableFlags = 2 << 13
	// TableFlagsSizingStretchProp columns default to _WidthStretch with default weights proportional to each columns contents widths.
	TableFlagsSizingStretchProp TableFlags = 3 << 13
	// TableFlagsSizingStretchSame columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
	TableFlagsSizingStretchSame TableFlags = 4 << 13

	// TableFlagsNoHostExtendX makes outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
	TableFlagsNoHostExtendX TableFlags = 1 << 16
	// TableFlagsNoHostExtendY makes outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
	TableFlagsNoHostExtendY TableFlags = 1 << 17
	// TableFlagsNoKeepColumnsVisible disables keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
	TableFlagsNoKeepColumnsVisible TableFlags = 1 << 18
	// TableFlagsPreciseWidths disables distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
	TableFlagsPreciseWidths TableFlags = 1 << 19

	// TableFlagsNoClip disables clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
	TableFlagsNoClip TableFlags = 1 << 20

	// TableFlagsPadOuterX Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers.
	TableFlagsPadOuterX TableFlags = 1 << 21
	// TableFlagsNoPadOuterX Default if BordersOuterV is off. Disable outer-most padding.
	TableFlagsNoPadOuterX TableFlags = 1 << 22
	// TableFlagsNoPadInnerX disables inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
	TableFlagsNoPadInnerX TableFlags = 1 << 23

	// TableFlagsScrollX enables horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
	TableFlagsScrollX TableFlags = 1 << 24
	// TableFlagsScrollY enables vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
	TableFlagsScrollY TableFlags = 1 << 25

	// TableFlagsSortMulti allows to hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
	TableFlagsSortMulti TableFlags = 1 << 26
	// TableFlagsSortTristate allows no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
	TableFlagsSortTristate TableFlags = 1 << 27
)

Tables [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out! - Full-featured replacement for old Columns API. - See Demo->Tables for demo code. - See top of imgui_tables.cpp for general commentary. - See TableFlags_ and TableColumnFlags_ enums for a description of available flags. The typical call flow is: - 1. Call BeginTable(). - 2. Optionally call TableSetupColumn() to submit column name/flags/defaults. - 3. Optionally call TableSetupScrollFreeze() to request scroll freezing of columns/rows. - 4. Optionally call TableHeadersRow() to submit a header row. Names are pulled from TableSetupColumn() data. - 5. Populate contents:

  • In most situations you can use TableNextRow() + TableSetColumnIndex(N) to start appending into a column.
  • If you are using tables as a sort of grid, where every columns is holding the same type of contents, you may prefer using TableNextColumn() instead of TableNextRow() + TableSetColumnIndex(). TableNextColumn() will automatically wrap-around into the next row if needed.
  • IMPORTANT: Comparatively to the old Columns() API, we need to call TableNextColumn() for the first column!
  • Summary of possible call flow: ---------------------------------------------------------------------------------------------------------- TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") -> TableSetColumnIndex(1) -> Text("Hello 1") // OK TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1") // OK: TableNextColumn() automatically gets to next row! TableNextRow() -> Text("Hello 0") // Not OK! Missing TableSetColumnIndex() or TableNextColumn()! Text will not appear! ----------------------------------------------------------------------------------------------------------

- 5. Call EndTable()

Flags for BeginTable() [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out!

  • Important! Sizing policies have complex and subtle side effects, more so than you would expect. Read comments/demos carefully + experiment with live demos to get acquainted with them.
  • The DEFAULT sizing policies are:
  • Default to TableFlagsSizingFixedFit if ScrollX is on, or if host window has WindowFlagsAlwaysAutoResize.
  • Default to TableFlagsSizingStretchSame if ScrollX is off.
  • When ScrollX is off:
  • Table defaults to TableFlagsSizingStretchSame -> all Columns defaults to TableColumnFlagsWidthStretch with same weight.
  • Columns sizing policy allowed: Stretch (default), Fixed/Auto.
  • Fixed Columns will generally obtain their requested width (unless the table cannot fit them all).
  • Stretch Columns will share the remaining width.
  • Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors. The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns. (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing).
  • When ScrollX is on:
  • Table defaults to TableFlagsSizingFixedFit -> all Columns defaults to TableColumnFlagsWidthFixed
  • Columns sizing policy allowed: Fixed/Auto mostly.
  • Fixed Columns can be enlarged as needed. Table will show an horizontal scrollbar if needed.
  • When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop.
  • Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable(). If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again.
  • Read on documentation at the top of imgui_tables.cpp for details.

type TableRowFlags

type TableRowFlags int

TableRowFlags for TableNextRowV().

const (
	// TableRowFlagsNone default = 0.
	TableRowFlagsNone TableRowFlags = 0
	// TableRowFlagsHeaders identify header row (set default background color + width of its contents accounted different for auto column width).
	TableRowFlagsHeaders TableRowFlags = 1 << 0
)

type TableSortSpecs

type TableSortSpecs uintptr

TableSortSpecs is a sort specs Sorting specifications for a table (often handling sort specs for a single column, occasionally more) Obtained by calling TableGetSortSpecs() When SpecsDirty() == true you can sort your data. It will be true with sorting specs have changed since last call, or the first time. Make sure to call ClearSpecsDirty() or SetSpecsDirty(false) after sorting, else you may wastefully sort your data every frame!

func TableGetSortSpecs

func TableGetSortSpecs() TableSortSpecs

TableGetSortSpecs gets latest sort specs for the table (0 if not sorting).

  • Call TableGetSortSpecs() to retrieve latest sort specs for the table. 0 when not sorting.
  • When 'SpecsDirty() == true' you should sort your data. It will be true when sorting specs have changed since last call, or the first time. Make sure to call ClearSpecsDirty() or SetSpecsDirty(false) after sorting, else you may wastefully sort your data every frame!
  • Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().

func (TableSortSpecs) ClearSpecsDirty

func (specs TableSortSpecs) ClearSpecsDirty()

ClearSpecsDirty calls specs.SetSpecsDirty(false).

func (TableSortSpecs) SetSpecsDirty

func (specs TableSortSpecs) SetSpecsDirty(value bool)

SetSpecsDirty sets SpecsDirty value to a given value, usually used to clear the flag (set to false).

func (TableSortSpecs) Specs

func (specs TableSortSpecs) Specs() []TableColumnSortSpecs

Specs returns columns sort spec array.

func (TableSortSpecs) SpecsCount

func (specs TableSortSpecs) SpecsCount() int

SpecsCount returns sort spec count. Most often 1 unless e.g. TableFlagsMultiSortable is enabled.

func (TableSortSpecs) SpecsDirty

func (specs TableSortSpecs) SpecsDirty() bool

SpecsDirty returns if specs have changed since last time! Use this to sort again.

type TextureID

type TextureID uintptr

TextureID is a user data to identify a texture.

TextureID is a uintptr used to pass renderer-agnostic texture references around until it hits your render function. imgui knows nothing about what those bits represent, it just passes them around. It is up to you to decide what you want the value to carry!

It could be an identifier to your OpenGL texture (cast as uint32), a key to your custom engine material, etc. At the end of the chain, your renderer takes this value to cast it back into whatever it needs to select a current texture to render.

To display a custom image/texture within an imgui window, you may use functions such as imgui.Image(). imgui will generate the geometry and draw calls using the TextureID that you passed and which your renderer can use. It is your responsibility to get textures uploaded to your GPU.

Note: Internally, the value is based on a pointer type, so its size is dependent on your architecture. For the most part, this will be 64bits on current systems (in 2018). Beware: This value must never be a Go pointer, because the value escapes the runtime!

type TreeNodeFlags

type TreeNodeFlags int

TreeNodeFlags for TreeNodeV(), CollapsingHeaderV(), etc.

const (
	// TreeNodeFlagsNone default = 0.
	TreeNodeFlagsNone TreeNodeFlags = 0
	// TreeNodeFlagsSelected draws as selected.
	TreeNodeFlagsSelected TreeNodeFlags = 1 << 0
	// TreeNodeFlagsFramed draws frame with background (e.g. for CollapsingHeader).
	TreeNodeFlagsFramed TreeNodeFlags = 1 << 1
	// TreeNodeFlagsAllowItemOverlap hit testing to allow subsequent widgets to overlap this one.
	TreeNodeFlagsAllowItemOverlap TreeNodeFlags = 1 << 2
	// TreeNodeFlagsNoTreePushOnOpen doesn't do a TreePush() when open
	// (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack.
	TreeNodeFlagsNoTreePushOnOpen TreeNodeFlags = 1 << 3
	// TreeNodeFlagsNoAutoOpenOnLog doesn't automatically and temporarily open node when Logging is active
	// (by default logging will automatically open tree nodes).
	TreeNodeFlagsNoAutoOpenOnLog TreeNodeFlags = 1 << 4
	// TreeNodeFlagsDefaultOpen defaults node to be open.
	TreeNodeFlagsDefaultOpen TreeNodeFlags = 1 << 5
	// TreeNodeFlagsOpenOnDoubleClick needs double-click to open node.
	TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = 1 << 6
	// TreeNodeFlagsOpenOnArrow opens only when clicking on the arrow part.
	// If TreeNodeFlagsOpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
	TreeNodeFlagsOpenOnArrow TreeNodeFlags = 1 << 7
	// TreeNodeFlagsLeaf allows no collapsing, no arrow (use as a convenience for leaf nodes).
	TreeNodeFlagsLeaf TreeNodeFlags = 1 << 8
	// TreeNodeFlagsBullet displays a bullet instead of an arrow.
	TreeNodeFlagsBullet TreeNodeFlags = 1 << 9
	// TreeNodeFlagsFramePadding uses FramePadding (even for an unframed text node) to
	// vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
	TreeNodeFlagsFramePadding TreeNodeFlags = 1 << 10
	// TreeNodeFlagsSpanAvailWidth extends hit box to the right-most edge, even if not framed.
	// This is not the default in order to allow adding other items on the same line.
	// In the future we may refactor the hit system to be front-to-back, allowing natural overlaps
	// and then this can become the default.
	TreeNodeFlagsSpanAvailWidth TreeNodeFlags = 1 << 11
	// TreeNodeFlagsSpanFullWidth extends hit box to the left-most and right-most edges (bypass the indented area).
	TreeNodeFlagsSpanFullWidth TreeNodeFlags = 1 << 12
	// TreeNodeFlagsNavLeftJumpsBackHere (WIP) Nav: left direction may move to this TreeNode() from any of its child
	// (items submitted between TreeNode and TreePop).
	TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = 1 << 13
	// TreeNodeFlagsCollapsingHeader combines TreeNodeFlagsFramed and TreeNodeFlagsNoAutoOpenOnLog.
	TreeNodeFlagsCollapsingHeader = TreeNodeFlagsFramed | TreeNodeFlagsNoTreePushOnOpen | TreeNodeFlagsNoAutoOpenOnLog
)

type Vec2

type Vec2 struct {
	X float32
	Y float32
}

Vec2 represents a two-dimensional vector.

func CalcTextSize

func CalcTextSize(text string, hideTextAfterDoubleHash bool, wrapWidth float32) Vec2

CalcTextSize calculates the size of the text.

func ContentRegionAvail

func ContentRegionAvail() Vec2

ContentRegionAvail returns the size of the content region that is available (based on the current cursor position).

func ContentRegionMax

func ContentRegionMax() Vec2

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

func CursorPos

func CursorPos() Vec2

CursorPos returns the cursor position in window coordinates (relative to window position).

func CursorScreenPos

func CursorScreenPos() Vec2

CursorScreenPos returns cursor position in absolute coordinates (useful to work with DrawList API). Generally top-left == MainViewport().Pos() == (0,0) in single viewport mode, and bottom-right == MainViewport().Pos()+Size == io.DisplaySize in single-viewport mode.

func CursorStartPos

func CursorStartPos() Vec2

CursorStartPos returns the initial cursor position in window coordinates.

func ItemRectMax

func ItemRectMax() Vec2

ItemRectMax returns the lower-right bounding rectangle of the last item in screen space.

func ItemRectMin

func ItemRectMin() Vec2

ItemRectMin returns the upper-left bounding rectangle of the last item in screen space.

func MouseDragDelta

func MouseDragDelta(button int, lockThreshold float32) Vec2

MouseDragDelta returns the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lockThreshold < -1.0f, uses io.MouseDraggingThreshold).

func MousePos

func MousePos() Vec2

MousePos returns the current mouse position in screen space.

func WindowContentRegionMax

func WindowContentRegionMax() Vec2

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

func WindowContentRegionMin

func WindowContentRegionMin() Vec2

WindowContentRegionMin returns the content boundaries min (roughly (0,0)-Scroll), in window coordinates.

func WindowPos

func WindowPos() Vec2

WindowPos returns the current window position in screen space. This is useful if you want to do your own drawing via the DrawList API.

func WindowSize

func WindowSize() Vec2

WindowSize returns the size of the current window.

func (Vec2) Minus

func (vec Vec2) Minus(other Vec2) Vec2

Minus returns vec - other.

func (Vec2) Plus

func (vec Vec2) Plus(other Vec2) Vec2

Plus returns vec + other.

func (Vec2) Times

func (vec Vec2) Times(value float32) Vec2

Times returns vec * value.

type Vec4

type Vec4 struct {
	X float32
	Y float32
	Z float32
	W float32
}

Vec4 represents a four-dimensional vector.

func (Vec4) Minus

func (vec Vec4) Minus(other Vec4) Vec4

Minus returns vec - other.

func (Vec4) Plus

func (vec Vec4) Plus(other Vec4) Vec4

Plus returns vec + other.

func (Vec4) Times

func (vec Vec4) Times(value float32) Vec4

Times returns vec * value.

type Viewport

type Viewport uintptr

Viewport A Platform Window (always only one in 'master' branch), in the future may represent Platform Monitor.

func MainViewport

func MainViewport() Viewport

MainViewport returns primary/default viewport. - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows. - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports. - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.

func (Viewport) Center

func (viewport Viewport) Center() Vec2

Center returns center of the viewport.

func (Viewport) Flags

func (viewport Viewport) Flags() ViewportFlags

Flags returns viewports flags value.

func (Viewport) Pos

func (viewport Viewport) Pos() Vec2

Pos returns viewports Main Area: Position of the viewport (Dear Imgui coordinates are the same as OS desktop/native coordinates).

func (Viewport) Size

func (viewport Viewport) Size() Vec2

Size returns viewports Main Area: Size of the viewport.

func (Viewport) WorkCenter

func (viewport Viewport) WorkCenter() Vec2

WorkCenter returns center of the viewport minus task bars, menu bars, status bars.

func (Viewport) WorkPos

func (viewport Viewport) WorkPos() Vec2

WorkPos returns viewports Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos).

func (Viewport) WorkSize

func (viewport Viewport) WorkSize() Vec2

WorkSize returns viewports Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size).

type ViewportFlags

type ViewportFlags int

ViewportFlags flags for viewport.

const (
	// ViewportFlagsNone default = 0.
	ViewportFlagsNone ViewportFlags = 0
	// ViewportFlagsIsPlatformWindow represents a Platform Window.
	ViewportFlagsIsPlatformWindow ViewportFlags = 1 << 0
	// ViewportFlagsIsPlatformMonitor represents a Platform Monitor (unused yet).
	ViewportFlagsIsPlatformMonitor ViewportFlags = 1 << 1
	// ViewportFlagsOwnedByApp Platform Window: is created/managed by the application (rather than a dear imgui backend).
	ViewportFlagsOwnedByApp ViewportFlags = 1 << 2
)

type WindowFlags

type WindowFlags int

WindowFlags for BeginV(), etc.

const (
	// WindowFlagsNone default = 0.
	WindowFlagsNone WindowFlags = 0
	// WindowFlagsNoTitleBar disables title-bar.
	WindowFlagsNoTitleBar WindowFlags = 1 << 0
	// WindowFlagsNoResize disables user resizing with the lower-right grip.
	WindowFlagsNoResize WindowFlags = 1 << 1
	// WindowFlagsNoMove disables user moving the window.
	WindowFlagsNoMove WindowFlags = 1 << 2
	// WindowFlagsNoScrollbar disables scrollbars. Window can still scroll with mouse or programmatically.
	WindowFlagsNoScrollbar WindowFlags = 1 << 3
	// WindowFlagsNoScrollWithMouse disables user vertically scrolling with mouse wheel. On child window, mouse wheel
	// will be forwarded to the parent unless NoScrollbar is also set.
	WindowFlagsNoScrollWithMouse WindowFlags = 1 << 4
	// WindowFlagsNoCollapse disables user collapsing window by double-clicking on it.
	WindowFlagsNoCollapse WindowFlags = 1 << 5
	// WindowFlagsAlwaysAutoResize resizes every window to its content every frame.
	WindowFlagsAlwaysAutoResize WindowFlags = 1 << 6
	// WindowFlagsNoBackground disables drawing background color (WindowBg, etc.) and outside border. Similar as using
	// SetNextWindowBgAlpha(0.0f).
	WindowFlagsNoBackground WindowFlags = 1 << 7
	// WindowFlagsNoSavedSettings will never load/save settings in .ini file.
	WindowFlagsNoSavedSettings WindowFlags = 1 << 8
	// WindowFlagsNoMouseInputs disables catching mouse, hovering test with pass through.
	WindowFlagsNoMouseInputs WindowFlags = 1 << 9
	// WindowFlagsMenuBar has a menu-bar.
	WindowFlagsMenuBar WindowFlags = 1 << 10
	// WindowFlagsHorizontalScrollbar allows horizontal scrollbar to appear (off by default). You may use
	// SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo
	// in the "Horizontal Scrolling" section.
	WindowFlagsHorizontalScrollbar WindowFlags = 1 << 11
	// WindowFlagsNoFocusOnAppearing disables taking focus when transitioning from hidden to visible state.
	WindowFlagsNoFocusOnAppearing WindowFlags = 1 << 12
	// WindowFlagsNoBringToFrontOnFocus disables bringing window to front when taking focus. e.g. clicking on it or
	// programmatically giving it focus.
	WindowFlagsNoBringToFrontOnFocus WindowFlags = 1 << 13
	// WindowFlagsAlwaysVerticalScrollbar always shows vertical scrollbar, even if ContentSize.y < Size.y .
	WindowFlagsAlwaysVerticalScrollbar WindowFlags = 1 << 14
	// WindowFlagsAlwaysHorizontalScrollbar always shows horizontal scrollbar, even if ContentSize.x < Size.x .
	WindowFlagsAlwaysHorizontalScrollbar WindowFlags = 1 << 15
	// WindowFlagsAlwaysUseWindowPadding ensures child windows without border uses style.WindowPadding (ignored by
	// default for non-bordered child windows, because more convenient).
	WindowFlagsAlwaysUseWindowPadding WindowFlags = 1 << 16
	// WindowFlagsNoNavInputs has no gamepad/keyboard navigation within the window.
	WindowFlagsNoNavInputs WindowFlags = 1 << 18
	// WindowFlagsNoNavFocus has no focusing toward this window with gamepad/keyboard navigation
	// (e.g. skipped by CTRL+TAB).
	WindowFlagsNoNavFocus WindowFlags = 1 << 19
	// WindowFlagsUnsavedDocument appends '*' to title without affecting the ID, as a convenience to avoid using the
	// ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one
	// frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker.
	WindowFlagsUnsavedDocument WindowFlags = 1 << 20

	// WindowFlagsNoNav combines WindowFlagsNoNavInputs and WindowFlagsNoNavFocus.
	WindowFlagsNoNav = WindowFlagsNoNavInputs | WindowFlagsNoNavFocus
	// WindowFlagsNoDecoration combines WindowFlagsNoTitleBar, WindowFlagsNoResize, WindowFlagsNoScrollbar and
	// WindowFlagsNoCollapse.
	WindowFlagsNoDecoration = WindowFlagsNoTitleBar | WindowFlagsNoResize | WindowFlagsNoScrollbar | WindowFlagsNoCollapse
	// WindowFlagsNoInputs combines WindowFlagsNoMouseInputs, WindowFlagsNoNavInputs and WindowFlagsNoNavFocus.
	WindowFlagsNoInputs = WindowFlagsNoMouseInputs | WindowFlagsNoNavInputs | WindowFlagsNoNavFocus
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL