parin.addons.microui.wrapper

High-level wrapper around the low-level core module. Provides helper functions that use a global context and follow D naming conventions.

Types 47

Used for getting the width of the text.

Used for getting the height of the text.

Used for drawing a frame.

aliasUiId = MuId

The control ID type of microui.

aliasUiFont = MuFont

The font type of microui.

The texture type of microui.

The slice repeat mode type of microui.

aliasUiRect = IRect
deprecated Use `IRect`. It's the same.

A 2D rectangle using ints.

aliasUiVec = IVec2
deprecated Use `IVec2`. It's the same.

A 2D vector using ints.

aliasUiFVec = Vec2
deprecated Use `Vec2`. It's the same.

A 2D vector using floats.

deprecated Use `Margin`. It's the same.

A set of 4 integer margins for left, top, right, and bottom.

deprecated Use `SlicePart`. It's the same.

A part of a 9-slice with source and target rectangles for drawing.

deprecated Use `SliceParts`. It's the same.

The parts of a 9-slice.

A pool item.

Base structure for all render commands, containing type and size metadata.

Command to jump to another location in the command buffer.

Command to set a clipping rectangle.

Command to draw a rectangle with a given color.

Command to render text at a given position with a font and color. The text is a null-terminated string. Use str.ptr to access it.

Command to draw an icon inside a rectangle with a given color.

A union of all possible render commands.

Layout state used to position UI controls within a container.

A UI container holding commands.

A 9-slice definition for an atlas area, controlling how it is sampled and tiled.

UI style settings including font, sizes, spacing, and colors.

The UI context.

The command kind.

deprecated Remove `Enum` from the type name.

The clipping kind.

aliasUiClip = MuClip

The clipping kind.

deprecated Remove `Enum` from the type name.

The color kind.

The color kind.

deprecated Remove `Enum` from the type name.

The icon kind.

aliasUiIcon = MuIcon

The icon kind.

deprecated Remove `Enum` from the type name.

The atlas area kind.

The atlas area kind.

Bitmask type for result flags.

Result flags indicating the outcome of a control interaction.

Bitmask type for option flags.

Option flags controlling control and window behaviour.

Bitmask type for mouse button flags.

Flags representing which mouse buttons are pressed.

Bitmask type for keyboard key flags.

Flags representing which keys are currently held down.

Used by the members function to hide data.

Used by the members function to show data in a specific way.

aliasbeginUi = beginUiFrame
deprecated Use `beginUiFrame`. It's a better name.

The old name of the beginUiFrame function.

aliasendUi = endUiFrame
deprecated Use `endUiFrame`. It's a better name.

The old name of the endUiFrame function.

Functions 82

fnUiStyle * uiStyle() ref
fnvoid readyUiCore(UiFont font = null, int fontScale = 1)
fnvoid readyUiCore(UiTextWidthFunc width, UiTextHeightFunc height, UiFont font = null, int fontScale = 1)
fnvoid beginUiCore()
fnvoid endUiCore()
fnvoid setUifocus(UiId id)
fnUiId getUiId(const(void) * data, Sz size)
fnvoid pushUiId(const(void) * data, Sz size)
fnvoid pushUiId(IStr str)
fnvoid popUiId()
fnvoid pushUiClipRect(IRect rect)
fnvoid popUiClipRect()
fnint readyUiPool(UiPoolItem * items, Sz len, UiId id)
fnint getFromUiPool(UiPoolItem * items, Sz len, UiId id)
fnvoid updateUiPool(UiPoolItem * items, Sz idx)
fnvoid uiInputMouseMove(int x, int y)
fnvoid uiInputMouseDown(int x, int y, UiMouseFlags input)
fnvoid uiInputMouseUp(int x, int y, UiMouseFlags input)
fnvoid uiInputScroll(int x, int y)
fnvoid uiInputKeyUp(UiKeyFlags input)
fnvoid uiInputText(IStr text)
fnvoid setUiClipRect(IRect rect)
fnvoid drawUiRect(IRect rect, Rgba color, UiAtlas id = UiAtlas.none)
fnvoid drawUibox(IRect rect, Rgba color)
fnvoid drawUiText(UiFont font, IStr str, IVec2 point, Rgba color)
fnvoid drawUiIcon(UiIcon id, IRect rect, Rgba color)
fnvoid beginColumn()
fnvoid endColumn()
fnvoid row(int height, const(int)[] widths...)
fnvoid setLayoutWidth(int width)
fnvoid setLayoutHeight(int height)
fnvoid setNextLayout(IRect rect, bool relative)
fnvoid drawControlFrame(UiId id, IRect rect, UiColor colorId, UiOptFlags opt, UiAtlas atlasId = UiAtlas.none)
fnvoid drawControlText(IStr text, IRect rect, UiColor colorId, UiOptFlags opt)
fnbool isUiMouseOver(IRect rect)
fnvoid updateControl(UiId id, IRect rect, UiOptFlags opt)
fnvoid text(IStr text)
fnvoid label(IStr text)
fnUiResFlags button(IStr label, UiIcon icon = UiIcon.none, UiOptFlags opt = UiOptFlag.alignCenter)
fnUiResFlags checkbox(ref bool state, IStr label = "")
fnUiResFlags textBox(Str buffer, ref Sz newlen, UiOptFlags opt = UiOptFlag.none)
fnMuResFlags textBox(Str buffer, ref IStr newslice, UiOptFlags opt = UiOptFlag.none)
fnMuResFlags textBox(Sz N = 128, IStr file = __FILE__, Sz line = __LINE__)(ref IStr newslice, UiOptFlags opt = UiOptFlag.none)
fnUiResFlags slider(ref float value, float low, float high, float step = 0.01f, IStr fmt = uiNumberFmt, UiOptFlags opt = UiOptFlag.alignCenter)
fnUiResFlags slider(ref int value, int low, int high, int step = 1, IStr fmt = uiNumberFmt, UiOptFlags opt = UiOptFlag.alignCenter)
fnUiResFlags number(ref float value, float step = 0.01f, IStr fmt = uiNumberFmt, UiOptFlags opt = UiOptFlag.alignCenter)
fnUiResFlags number(ref int value, int step = 1, IStr fmt = uiNumberFmt, UiOptFlags opt = UiOptFlag.alignCenter)
fnUiResFlags header(IStr label, UiOptFlags opt = UiOptFlag.none)
fnvoid members(T)(ref T data, int labelWidth, bool canShowPrivateMembers = false)
fnUiResFlags headerAndMembers(T)(ref T data, int labelWidth, IStr label = "", bool canShowPrivateMembers = false)
fnUiResFlags beginTreeNode(IStr label, UiOptFlags opt = UiOptFlag.none)
fnvoid endTreeNode()
fnUiResFlags beginWindow(IStr title, IRect rect, UiOptFlags opt = UiOptFlag.none)
fnUiResFlags beginWindow(IStr title, int x, int y, int w, int h, UiOptFlags opt = UiOptFlag.none)
fnvoid endWindow()
fnvoid openPopup(IStr name)
fnvoid endPopup()
fnvoid beginPanel(IStr name, UiOptFlags opt = UiOptFlag.none)
fnvoid endPanel()
fnvoid openDMenu()
fnUiResFlags beginDMenu(ref IStr selection, const(IStr)[] items, IVec2 canvas, IStr label = "", Vec2 scale = Vec2(0.5f, 0.7f))
fnvoid endDMenu()
fnint tempMuUiTextWidthFunc(UiFont font, IStr str) @trusted
fnint tempMuUiTextHeightFunc(UiFont font) @trusted
fnvoid readyUi(UiFont font = null, int fontScale = 1) @trustedInitializes the microui context and sets temporary text size functions. Value `font` should be a `FontId*`.
fnvoid readyUi(int fontScale)Initializes the microui context and sets temporary text size functions.
fnvoid readyUi(FontId font, int fontScale = 1)Initializes the microui context and sets temporary text size functions.
fnvoid handleUiInput() @trustedHandles input events and updates the microui context accordingly.
fnvoid drawUiState() @trustedDraws the microui context to the screen.
fnvoid beginUiFrame()Begins input handling and UI processing.
fnvoid endUiFrame()Ends UI processing and performs drawing.

Variables 3

varUiContext uiContext
enumvaruiNumberFmt = muNumberFmt

Format string used for numbers.

enumvaruiNumberFmtWithZero = muNumberFmtWithZero

Format string used for numbers, with a zero at the end.