parin.ui

The ui module functions as a immediate mode UI library.

Types 3

enumUiDragLimit : ubyte

A type representing the constraints on drag movement.

noneNo limits.
viewportLimited to the viewport.
viewportAndXLimited to the viewport and on the X-axis.
viewportAndYLimited to the viewport and on the Y-axis.
customLimited to custom limits.
customAndXLimited to custom limits and on the X-axis.
customAndYLimited to custom limits and on the Y-axis.
structUiOptions
Fields
FontId font
Rgba fontColor
ubyte fontScale
ubyte fontAlphaOffset
Rgba disabledColor
Rgba idleColor
Rgba hotColor
Rgba activeColor
Alignment alignment
short alignmentOffset
UiDragLimit dragLimit
Vec2 dragLimitX
Vec2 dragLimitY
bool isDisabled
Constructors
this(ubyte fontScale)
this(Alignment alignment, short alignmentOffset = 0)
this(UiDragLimit dragLimit)
structUiState
Fields
Mouse mouseClickAction
Keyboard keyboardClickAction
Gamepad gamepadClickAction
bool isActOnPress
Vec2 viewportPosition
Vec2 viewportSize
Vec2 viewportScale
Vec2 mouseBuffer
Vec2 mousePressedPosition
Vec2 itemDragOffset
short itemId
short hotItemId
short activeItemId
short clickedItemId
short draggedItemId
short focusedItemId
short previousMaxHotItemId
short previousMaxHotItemIdBuffer

Functions 39

fnvoid prepareUi() @trusted @safe nothrow
fnbool isSpaceInTextField(char c) @safe nothrow @nogc
fnint findSpaceInTextField(IStr text) @safe nothrow @nogc
fnVec2 uiMouse() @safe nothrow @nogc
fnvoid setUiClickAction(Mouse value) @safe nothrow @nogc
fnvoid setUiClickAction(Keyboard value) @safe nothrow @nogc
fnvoid setUiClickAction(Gamepad value) @safe nothrow @nogc
fnbool isUiActOnPress() @safe nothrow @nogc
fnvoid setIsUiActOnPress(bool value) @safe nothrow @nogc
fnvoid setUiViewportState(Vec2 position, Vec2 size, Vec2 scale) @safe nothrow @nogc
fnshort uiItemId() @safe nothrow @nogc
fnbool isUiItemHot() @safe nothrow @nogc
fnbool isUiHot() @safe nothrow @nogc
fnbool isUiItemActive() @safe nothrow @nogc
fnbool isUiActive() @safe nothrow @nogc
fnbool isUiItemClicked() @safe nothrow @nogc
fnbool isUiClicked() @safe nothrow @nogc
fnbool isUiItemDragged() @safe nothrow @nogc
fnbool isUiDragged() @safe nothrow @nogc
fnVec2 uiDragOffset() @safe nothrow @nogc
fnbool isUiItemFocused() @safe nothrow @nogc
fnbool isUiFocused() @safe nothrow @nogc
fnshort uiFocus() @safe nothrow @nogc
fnvoid setUiFocus(short id) @safe nothrow @nogc
fnvoid clampUiFocus(short step, Sz length) @safe nothrow @nogc
fnvoid wrapUiFocus(short step, Sz length) @safe nothrow @nogc
fnvoid updateUiState(Rect area, bool isHot, bool isActive, bool isClicked) @safe nothrow @nogc
fnvoid updateUiText(Rect area, IStr text, UiOptions options = UiOptions()) @safe nothrow @nogc
fnvoid drawUiText(Rect area, IStr text, UiOptions options = UiOptions()) @safe nothrow @nogc
fnvoid uiText(Rect area, IStr text, UiOptions options = UiOptions()) @safe nothrow @nogc
fnbool updateUiButton(Rect area, IStr text, UiOptions options = UiOptions()) @safe nothrow @nogc
fnvoid drawUiButton(Rect area, IStr text, bool isHot, bool isActive, UiOptions options = UiOptions()) @safe nothrow @nogc
fnbool uiButton(Rect area, IStr text, UiOptions options = UiOptions()) @safe nothrow @nogc
fnbool updateUiDragHandle(ref Rect area, UiOptions options = UiOptions()) @safe nothrow @nogc
fnvoid drawUiDragHandle(Rect area, bool isHot, bool isActive, UiOptions options = UiOptions()) @safe nothrow @nogc
fnbool uiDragHandle(ref Rect area, UiOptions options = UiOptions()) @safe nothrow @nogc
fnbool updateUiTextField(Rect area, ref Str text, Str textBuffer, UiOptions options = UiOptions()) @trusted @safe nothrow @nogc
fnvoid drawUiTextField(Rect area, Str text, UiOptions options = UiOptions()) @safe nothrow @nogc
fnbool uiTextField(Rect area, ref Str text, Str textBuffer, UiOptions options = UiOptions()) @safe nothrow @nogc

Variables 9

varUiState * _uiState
varUiState * _uiPreviousState
enumvardefaultUiDisabledColor = 0x202020.toRgb()
enumvardefaultUiIdleColor = 0x414141.toRgb()
enumvardefaultUiHotColor = 0x818181.toRgb()
enumvardefaultUiActiveColor = 0xBABABA.toRgb()
enumvardefaultUiFontAlphaOffset = 50
enumvardefaultUiTextFieldCursorDisabledAlpha = 175
enumvardefaultUiTextFieldCursorOffset = 2