mitiru::ui

UI layer used inside C++ tooling and HUD layouts. Layout presets, controls, theming, and the editor's docking system.

UI layer used inside C++ tooling and HUD layouts. Layout presets, controls, theming, and the editor's docking system.

NameKindItems
UIAccessibilityConfigstruct8
FocusIndicatorStylestruct5
UIElementDescriptionstruct5
ConstraintTypeenum13
UIConstraintstruct4
SolvedBoundsstruct12
ConstraintLayoutclass5
DialogueLinestruct4
DialogueChoicestruct2
DialogueBoxStylestruct5
DialogueBoxclass58
FlexDirectionenum4
FlexWrapenum3
FlexJustifyenum6
FlexAlignItemsenum5
FlexAlignContentenum7
FlexAlignSelfenum6
FlexConfigstruct6
FlexItemConfigstruct7
FlexLayoutclass1
GridAlignenum5
TrackFixedstruct1
TrackFractionstruct1
GridPlacementstruct4
GridLayoutConfigstruct6
GridAreastruct5
GridLayoutclass4
Anchorenum9
LayoutDirectionenum2
SizeModeenum6
Marginstruct6
LayoutConstraintsstruct12
LayoutResultstruct2
LayoutEngineclass7
ModalButtonStyleenum4
ModalStateenum4
ModalButtonstruct4
ModalBackdropstruct2
ModalAnimationstruct4
ModalConfigstruct9
Modalclass26
ModalManagerclass14
ResponsivePropertyenum7
ResponsiveStrategyenum2
Breakpointstruct3
ResponsiveRulestruct5
ResponsiveLayoutclass14
Sideenum6
Insetsstruct6
ColumnLayoutstruct1
SplitHstruct2
SplitVstruct2
LayoutPanelStylestruct1
LayoutButtonStylestruct2
TabDefstruct1
FormFieldstruct2
ScreenLayoutclass21
ScrollBarStylestruct6
ScrollViewConfigstruct14
VirtualScrollRangestruct3
ScrollViewclass37
AnchorPresetenum12
UIAnchorConfigstruct10
UIResolvedBoundsstruct3
UIAnchorEntrystruct6
UIAnchorLayoutclass6
UIAnimationTypeenum10
UIAnimationstruct7
UIAnimationTransformstruct8
UIAnimationStatestruct5
UIAnimatorclass8
UIBuilderclass32
UIBindPropertyenum15
UIBindingEntrystruct3
UITwoWayBindingEntrystruct4
UIExpressionBindingEntrystruct2
UIListBindingEntrystruct4
UIBindingContextclass12
DropResultTypeenum4
DropZoneHighlightenum4
DragPayloadstruct4
DropResultstruct2
DropTargetstruct4
DragRenderInfostruct4
DropZoneRenderInfostruct3
UIDragDropManagerclass18
UIEventTypeenum20
UIEventstruct10
UIEventDispatcherclass5
UIEventTypeenum7
UIEventstruct8
UIEventLogclass10
UIEventPhaseenum4
MouseEventTypeenum4
KeyEventTypeenum6
UIMouseEventstruct11
UIKeyEventstruct9
UIFocusEventstruct6
UIEventProcessorclass10
UIFocusManagerclass15
NineSliceRegionsstruct2
UIRoleenum22
UINodeDatastruct8
UINodeclass34
NotificationTypeenum5
NotificationPositionenum6
NotificationActionstruct2
UINotificationstruct6
NotificationQueueConfigstruct6
NotificationRenderInfostruct6
UINotificationQueueclass23
UIPrefabNodeDefstruct10
UIPrefabclass5
UIStateManagerclass4
UIRendererclass4
RichTextSegmentstruct6
RichTextMeasurementstruct3
UIRichTextclass7
SmartTooltipPositionenum5
TooltipContentTypeenum4
SmartTooltipConfigstruct7
SmartTooltipclass22
SmartTooltipGroupclass7
UIElementInfostruct9
UISnapshotclass4
UIVisualStateenum6
UIDragStatestruct5
UIInteractiveStatestruct9
UIStateManagerclass6
UIVisualStateenum5
UIFontWeightenum2
UITextAlignenum3
UIVerticalAlignenum3
UITextOverflowenum3
UIEdgeInsetsstruct6
UIOffsetstruct2
UINineSliceConfigstruct10
UIWidgetMetricsstruct19
UIBoxStylestruct7
UITextStylestruct7
UIBoxStyleOverridestruct8
UITextStyleOverridestruct3
UIStateStylesstruct12
UIStyleSheetclass9
UITemplateclass7
ThemeMetricsstruct8
UIThemeStylestruct5
UIThemeclass13
UINodePropertiesstruct9
UIStatestruct2
UITransitionDefstruct5
UINodeTransitionStatestruct6
UIActiveTransitionstruct4
UIStateManagerclass10
UIAccordionSectionstruct5
UIAccordionConfigstruct17
UIAccordionclass10
AvatarStatusenum5
UIAvatarConfigstruct16
UIAvatarclass14
BadgePositionenum4
UIBadgeConfigstruct16
UIBadgeclass10
ButtonStateenum4
UIButtonConfigstruct7
UIButtonclass13
UICardContentstruct5
UICardConfigstruct22
UICardclass12
UICarouselItemstruct3
UICarouselConfigstruct22
UICarouselclass14
UIChatMessagestruct5
UIChatChannelstruct3
UIChatScrollBarStylestruct4
UIChatWindowConfigstruct16
UIChatWindowclass26
ColorPickerInteractionenum5
UIColorRGBAstruct4
UIColorHSVstruct3
UIColorPresetstruct4
UIColorPickerConfigstruct17
UIColorPickerclass19
UIMenuItemDefstruct6
UIContextMenuConfigstruct17
UIContextMenuclass23
WindowResizeEdgeenum9
UIDraggableWindowConfigstruct24
UIDraggableWindowclass30
UIDropdownConfigstruct7
UIDropdownclass20
FloatingTextFontWeightenum8
UIFloatingTextStylestruct6
UIFloatingTextConfigstruct6
UIFloatingTextEntrystruct18
UIFloatingTextManagerclass10
UIFormFieldTypeenum7
LabelAlignenum3
UIFormErrorstruct2
UIFormFieldstruct12
UIFormConfigstruct11
UIFormclass23
HotbarOrientationenum2
UIHotbarConfigstruct13
UIHotbarSlotstruct7
UIHotbarclass19
ItemRarityenum5
GridPosstruct4
UIInventoryItemstruct7
UIInventoryGridConfigstruct13
UIInventoryGridclass29
UIListItemstruct3
UIListViewConfigstruct7
UIListViewclass23
UIMenuDefstruct3
UIMenuBarConfigstruct20
UIMenuBarclass28
UINumberSpinnerConfigstruct17
UINumberSpinnerclass21
ProgressLabelFormatenum3
UIProgressBarConfigstruct11
UIProgressBarclass13
RadialMenuAnimationenum2
UIRadialMenuItemstruct5
UIRadialMenuConfigstruct14
UIRadialSectorInfostruct11
UIRadialMenuclass23
RadioOrientationenum2
UIRadioOptionstruct4
UIRadioGroupConfigstruct12
UIRadioGroupclass13
Orientationenum2
UISliderConfigstruct10
UISliderclass16
SplitterOrientationenum2
UISplitterConfigstruct14
UISplitterclass17
TabBarOrientationenum4
UITabBarConfigstruct8
UITabBarclass11
TableAlignenum3
UITableColumnstruct8
UITableRowstruct4
UITableConfigstruct17
UITableclass26
UITextInputConfigstruct9
UITextInputclass23
ToastPositionenum6
ToastStackDirectionenum2
ToastTypeenum4
ToastSlideDirectionenum4
UIToastTypeStylestruct2
UIToastConfigstruct27
UIToastEntrystruct6
UIToastManagerclass18
ToggleStyleenum2
UIToggleConfigstruct8
UIToggleclass10
TooltipPositionenum5
UITooltipConfigstruct20
UITooltipclass21
UITreeNodestruct8
UITreeViewConfigstruct13
UITreeViewclass22

Free functions and typedefs

using ColorBlindMode = vn::ColorBlindMode;
using ColorTransform = vn::ColorTransform;
[[nodiscard]] inline sgc::Rectf computeFocusIndicatorBounds( const UINode& node, const FocusIndicatorStyle& style = {}) noexcept
[[nodiscard]] inline float computeFocusIndicatorOpacity( const FocusIndicatorStyle& style, float elapsedTime) noexcept
[[nodiscard]] inline std::string roleToString(UIRole role) noexcept
[[nodiscard]] inline UIElementDescription describeNode(const UINode& node)
[[nodiscard]] inline std::vector<UIElementDescription> traverseForScreenReader( const UINode& root)
[[nodiscard]] inline std::string generateScreenReaderText(const UINode& root)
[[nodiscard]] inline sgc::Colorf applyColorBlindTransform( const sgc::Colorf& color, ColorBlindMode mode) noexcept
[[nodiscard]] inline bool shouldReduceMotion( const UIAccessibilityConfig& config) noexcept
[[nodiscard]] inline float adjustAnimationDuration( float baseDuration, const UIAccessibilityConfig& config) noexcept
[[nodiscard]] inline float adjustFontSize( float baseFontSize, const UIAccessibilityConfig& config) noexcept
struct UIAccessibilityConfig 8
bool highContrast = false
bool reducedMotion = false
bool screenReaderEnabled = false
float textSizeMultiplier = 1.0f
float letterSpacing = 1.0f
float lineSpacing = 1.0f
ColorBlindMode colorBlindMode = ColorBlindMode::None
void setTextSizeMultiplier(float multiplier) noexcept
struct FocusIndicatorStyle 5
float thickness = 2.0f
float padding = 2.0f
float cornerRadius = 4.0f
bool pulsate = true
float pulsateSpeed = 2.0f
struct UIElementDescription 5
UINodeId id = INVALID_UI_NODE
std::string role
std::string name
std::string value
std::string state
enum ConstraintType : uint8_t 13
LeftToLeft
LeftToRight
RightToRight
RightToLeft
TopToTop
TopToBottom
BottomToBottom
BottomToTop
CenterX
CenterY
Width
Height
AspectRatio
struct UIConstraint 4
ConstraintType type = ConstraintType::LeftToLeft
std::string target
float offset = 0.0f
float multiplier = 1.0f
struct SolvedBounds 12
float left = 0.0f
float top = 0.0f
float width = 0.0f
float height = 0.0f
[[nodiscard]] float right() const noexcept
[[nodiscard]] float bottom() const noexcept
[[nodiscard]] float centerX() const noexcept
[[nodiscard]] float centerY() const noexcept
void setRight(float v) noexcept
void setBottom(float v) noexcept
void setCenterX(float v) noexcept
void setCenterY(float v) noexcept
class ConstraintLayout 5
void addConstraint(const std::string& nodeId, UIConstraint constraint)
void clearConstraints(const std::string& nodeId)
void clearAll() noexcept
void setDefaultSize(const std::string& nodeId, float w, float h)
[[nodiscard]] std::map<std::string, sgc::Rectf> solve( const sgc::Rectf& parentBounds) const
struct DialogueLine 4
std::string speaker
std::string text
std::string portraitKey
std::optional<float> revealSpeedOverride
struct DialogueChoice 2
std::string label
int id = 0
struct DialogueBoxStyle 5
std::string background = "#000000C8"
std::string textColor = "#F0F0F0FF"
std::string speakerColor = "#FFD95AFF"
float padding = 16.0f
std::string fontFamily
class DialogueBox 58
using json = ::nlohmann::json;
DialogueBox() = default
void setLines(std::vector<DialogueLine> lines)
void setChoices(std::vector<DialogueChoice> choices)
void setStyle(DialogueBoxStyle style) noexcept
const DialogueBoxStyle& style() const noexcept
void setDefaultRevealSpeed(float charsPerSec) noexcept
void setClickCooldown(float seconds) noexcept
void update(float dt, bool primaryActionPressed)
void advance()
bool selectChoice(int id)
void restart() noexcept
const DialogueLine* currentLine() const noexcept
std::string visibleText() const
[[nodiscard]] bool isComplete() const noexcept
[[nodiscard]] bool awaitingChoice() const noexcept
[[nodiscard]] bool isRevealing() const noexcept
[[nodiscard]] std::size_t lineIndex() const noexcept
[[nodiscard]] float revealProgress() const noexcept
[[nodiscard]] std::optional<int> selectedChoice() const noexcept
[[nodiscard]] const std::vector<DialogueLine>& lines() const noexcept
[[nodiscard]] const std::vector<DialogueChoice>& choices() const noexcept
json toJson() const
using EasingType = vn::EasingType;
[[nodiscard]] constexpr float linear(float t) noexcept
[[nodiscard]] constexpr float easeInQuad(float t) noexcept
[[nodiscard]] constexpr float easeOutQuad(float t) noexcept
[[nodiscard]] constexpr float easeInOutQuad(float t) noexcept
[[nodiscard]] constexpr float easeInCubic(float t) noexcept
[[nodiscard]] constexpr float easeOutCubic(float t) noexcept
[[nodiscard]] constexpr float easeInOutCubic(float t) noexcept
[[nodiscard]] constexpr float easeInQuart(float t) noexcept
[[nodiscard]] constexpr float easeOutQuart(float t) noexcept
[[nodiscard]] constexpr float easeInOutQuart(float t) noexcept
[[nodiscard]] constexpr float easeInQuint(float t) noexcept
[[nodiscard]] constexpr float easeOutQuint(float t) noexcept
[[nodiscard]] constexpr float easeInOutQuint(float t) noexcept
[[nodiscard]] inline float easeInSine(float t) noexcept
[[nodiscard]] inline float easeOutSine(float t) noexcept
[[nodiscard]] inline float easeInOutSine(float t) noexcept
[[nodiscard]] inline float easeInExpo(float t) noexcept
[[nodiscard]] inline float easeOutExpo(float t) noexcept
[[nodiscard]] inline float easeInOutExpo(float t) noexcept
[[nodiscard]] inline float easeInCirc(float t) noexcept
[[nodiscard]] inline float easeOutCirc(float t) noexcept
[[nodiscard]] inline float easeInOutCirc(float t) noexcept
[[nodiscard]] inline float easeInElastic(float t) noexcept
[[nodiscard]] inline float easeOutElastic(float t) noexcept
[[nodiscard]] inline float easeInOutElastic(float t) noexcept
[[nodiscard]] constexpr float easeInBack(float t) noexcept
[[nodiscard]] constexpr float easeOutBack(float t) noexcept
[[nodiscard]] constexpr float easeInOutBack(float t) noexcept
[[nodiscard]] constexpr float easeInBounce(float t) noexcept
[[nodiscard]] constexpr float easeOutBounce(float t) noexcept
[[nodiscard]] constexpr float easeInOutBounce(float t) noexcept
[[nodiscard]] inline float cubicBezier( float x1, float y1, float x2, float y2, float t) noexcept
[[nodiscard]] inline float spring( float damping, float frequency, float t) noexcept
[[nodiscard]] inline float apply(EasingType type, float t) noexcept
enum FlexDirection : uint8_t 4
Row
RowReverse
Column
ColumnReverse
enum FlexWrap : uint8_t 3
NoWrap
Wrap
WrapReverse
enum FlexJustify : uint8_t 6
FlexStart
FlexEnd
Center
SpaceBetween
SpaceAround
SpaceEvenly
enum FlexAlignItems : uint8_t 5
FlexStart
FlexEnd
Center
Stretch
Baseline
enum FlexAlignContent : uint8_t 7
FlexStart
FlexEnd
Center
SpaceBetween
SpaceAround
SpaceEvenly
Stretch
enum FlexAlignSelf : uint8_t 6
Auto
FlexStart
FlexEnd
Center
Stretch
Baseline
struct FlexConfig 6
FlexDirection direction = FlexDirection::Row
FlexWrap wrap = FlexWrap::NoWrap
FlexJustify justifyContent = FlexJustify::FlexStart
FlexAlignItems alignItems = FlexAlignItems::Stretch
FlexAlignContent alignContent = FlexAlignContent::Stretch
float gap = 0.0f
struct FlexItemConfig 7
float flexGrow = 0.0f
float flexShrink = 1.0f
float flexBasis = -1.0f
FlexAlignSelf alignSelf = FlexAlignSelf::Auto
int order = 0
float preferredWidth = 0.0f
float preferredHeight = 0.0f
class FlexLayout 1
[[nodiscard]] std::vector<sgc::Rectf> compute( const sgc::Rectf& parentBounds, const FlexConfig& config, const std::vector<FlexItemConfig>& items) const
enum GridAlign : uint8_t 5
Start
Center
End
Stretch
using GridTrackSize = std::variant<TrackFixed, TrackFraction, TrackAuto>;
struct TrackFixed 1
float pixels = 0.0f
struct TrackFraction 1
float value = 1.0f
struct GridPlacement 4
int column = -1
int row = -1
int columnSpan = 1
int rowSpan = 1
struct GridLayoutConfig 6
std::vector<GridTrackSize> columns
std::vector<GridTrackSize> rows
float columnGap = 0.0f
float rowGap = 0.0f
GridAlign justifyItems = GridAlign::Stretch
GridAlign alignItems = GridAlign::Stretch
struct GridArea 5
std::string name
int column = 0
int row = 0
int columnSpan = 1
int rowSpan = 1
class GridLayout 4
void defineArea(const std::string& name, int col, int row, int colSpan, int rowSpan)
[[nodiscard]] GridPlacement placeInArea(const std::string& areaName) const
void clearAreas() noexcept
[[nodiscard]] std::vector<sgc::Rectf> compute( const sgc::Rectf& parentBounds, const GridLayoutConfig& config, std::vector<GridPlacement> placements, const std::vector<ChildHint>& hints) const
enum Anchor : uint8_t 9
TopLeft
TopCenter
TopRight
CenterLeft
Center
CenterRight
BottomLeft
BottomCenter
BottomRight
enum LayoutDirection : uint8_t 2
Horizontal
Vertical
enum SizeMode : uint8_t 6
Fixed
Fill
Wrap
Percent
inline float clampf(float value, float lo, float hi) noexcept
inline float resolveDimension(SizeMode mode, float specified, float parentDim, float contentDim, float minDim, float maxDim) noexcept
struct Margin 6
float top = 0.0f
float right = 0.0f
float bottom = 0.0f
float left = 0.0f
static Margin all(float v) noexcept
static Margin symmetric(float h, float v) noexcept
struct LayoutConstraints 12
SizeMode widthMode = SizeMode::Wrap
SizeMode heightMode = SizeMode::Wrap
float width = 0.0f
float height = 0.0f
float minWidth = 0.0f
float minHeight = 0.0f
float maxWidth = 99999.0f
float maxHeight = 99999.0f
Anchor anchor = Anchor::TopLeft
float spacing = 0.0f
LayoutDirection direction = LayoutDirection::Vertical
float flex = 0.0f
struct LayoutResult 2
sgc::Rectf bounds
std::string nodeId
class LayoutEngine 7
LayoutEngine(float screenW, float screenH) noexcept
void setScreenSize(float w, float h) noexcept
float screenWidth() const noexcept
float screenHeight() const noexcept
sgc::Rectf computeAnchored(const LayoutConstraints& constraints, float contentW, float contentH) const noexcept
std::vector<sgc::Rectf> layoutChildren( const sgc::Rectf& parentBounds, const std::vector<LayoutConstraints>& childConstraints, LayoutDirection direction, float spacing = 0.0f) const noexcept
void layoutTree(UINode& root, const std::map<UINodeId, LayoutConstraints>& constraints) const
enum ModalButtonStyle : std::uint8_t 4
Default
Primary
Danger
Cancel
enum ModalState : std::uint8_t 4
Hidden
FadingIn
Visible
FadingOut
struct ModalButton 4
std::string label
std::string resultId
ModalButtonStyle style = ModalButtonStyle::Default
bool focused = false
struct ModalBackdrop 2
float opacity = 0.5f
bool dismissOnClick = false
struct ModalAnimation 4
float fadeInDuration = 0.2f
float fadeOutDuration = 0.15f
EasingType showEasing = EasingType::EaseOutBack
EasingType hideEasing = EasingType::EaseInQuad
struct ModalConfig 9
std::string title
std::string content
std::vector<ModalButton> buttons
ModalBackdrop backdrop
ModalAnimation animation
bool escapeToClose = true
std::string escapeResultId = "cancel"
float width = 400.0f
float minHeight = 0.0f
class Modal 26
Modal() noexcept = default
explicit Modal(const UITheme& theme) noexcept
void show(ModalConfig config)
void dismiss(const std::string& resultId)
void hide() noexcept
void onConfirmPressed()
void onEscapePressed()
void onBackdropClicked()
void onFocusPrev() noexcept
void onFocusNext() noexcept
void onButtonClicked(int index)
void update(float deltaTime) noexcept
void setOnResult(std::function<void(const std::string&)> fn)
void setTheme(const UITheme& theme) noexcept
[[nodiscard]] const UITheme& theme() const noexcept
[[nodiscard]] ModalState state() const noexcept
[[nodiscard]] bool isVisible() const noexcept
[[nodiscard]] bool isModal() const noexcept
[[nodiscard]] const std::string& resultId() const noexcept
[[nodiscard]] float animProgress() const noexcept
[[nodiscard]] float displayScale() const noexcept
[[nodiscard]] float displayAlpha() const noexcept
[[nodiscard]] float backdropAlpha() const noexcept
[[nodiscard]] const ModalConfig& config() const noexcept
[[nodiscard]] const std::vector<ModalButton>& buttons() const noexcept
[[nodiscard]] int focusIndex() const noexcept
class ModalManager 14
void push(ModalConfig config, std::function<void(const std::string&)> onResult = nullptr)
[[nodiscard]] bool hasActiveModal() const noexcept
[[nodiscard]] std::size_t count() const noexcept
[[nodiscard]] const Modal* top() const noexcept
[[nodiscard]] Modal* top() noexcept
void onConfirmPressed()
void onEscapePressed()
void onFocusPrev()
void onFocusNext()
void onButtonClicked(int index)
void onBackdropClicked()
void update(float deltaTime)
[[nodiscard]] std::size_t modalCount() const noexcept
[[nodiscard]] const Modal& modalAt(std::size_t index) const
enum ResponsiveProperty : uint8_t 7
Visible
FontSize
Width
Height
Opacity
Text
Custom
enum ResponsiveStrategy : uint8_t 2
MobileFirst
DesktopFirst
struct Breakpoint 3
std::string name
float minWidth = 0.0f
float maxWidth = 99999.0f
struct ResponsiveRule 5
std::string breakpoint
std::string nodeId
ResponsiveProperty property = ResponsiveProperty::Custom
std::string customKey
std::string value
class ResponsiveLayout 14
void addBreakpoint(const std::string& name, float minWidth)
void removeBreakpoint(const std::string& name)
[[nodiscard]] const std::vector<Breakpoint>& breakpoints() const noexcept
void setRule(const std::string& breakpoint, const std::string& nodeId, ResponsiveProperty property, const std::string& value)
void setCustomRule(const std::string& breakpoint, const std::string& nodeId, const std::string& key, const std::string& value)
void clearRulesForNode(const std::string& nodeId)
void clearAllRules() noexcept
void setStrategy(ResponsiveStrategy strategy) noexcept
[[nodiscard]] ResponsiveStrategy strategy() const noexcept
void mobileFirst()
void desktopFirst()
[[nodiscard]] std::string activeBreakpoint(float viewportWidth) const
void apply(float viewportWidth, UINode& root) const
void applyCustom( float viewportWidth, const std::function<void(const std::string& nodeId, ResponsiveProperty property, const std::string& customKey, const std::string& value)>& applicator) const
enum Side : uint8_t 6
Left
Right
[[nodiscard]] inline constexpr sgc::Rectf applyInsets( const sgc::Rectf& r, const Insets& ins) noexcept
[[nodiscard]] inline SplitH splitHorizontal( const sgc::Rectf& r, float ratio, float gap = 0.0f) noexcept
[[nodiscard]] inline SplitV splitVertical( const sgc::Rectf& r, float ratio, float gap = 0.0f) noexcept
[[nodiscard]] inline ColumnLayout columnLayout( const sgc::Rectf& area, int count, float cellH, float gap) noexcept
struct Insets 6
float top = 0.0f
float right = 0.0f
float bottom = 0.0f
float left = 0.0f
static constexpr Insets uniform(float v) noexcept
static constexpr Insets symmetric(float h, float v) noexcept
struct ColumnLayout 1
std::vector<sgc::Rectf> cells
struct SplitH 2
sgc::Rectf left
sgc::Rectf right
struct SplitV 2
sgc::Rectf top
sgc::Rectf bottom
struct LayoutPanelStyle 1
float borderWidth = 1.0f
struct LayoutButtonStyle 2
float fontSize = 16.0f
float borderWidth = 1.0f
struct TabDef 1
std::string label
struct FormField 2
std::string label
std::string value
class ScreenLayout 21
explicit ScreenLayout(Screen& screen) noexcept
[[nodiscard]] Screen& screen() noexcept
[[nodiscard]] const Screen& screen() const noexcept
void drawCenteredPanel(float w, float h, const LayoutPanelStyle& style)
void drawHeader(std::string_view title, float height = 60.0f, const sgc::Colorf& bg = sgc::Colorf{0.1f, 0.1f, 0.15f, 1.0f}, const sgc::Colorf& textColor = sgc::Colorf{1.0f, 1.0f, 1.0f, 1.0f})
void drawFooter(std::string_view text, float height = 40.0f, const sgc::Colorf& bg = sgc::Colorf{0.08f, 0.08f, 0.1f, 1.0f}, const sgc::Colorf& textColor = sgc::Colorf{0.7f, 0.7f, 0.7f, 1.0f})
[[nodiscard]] sgc::Rectf drawSidebar( float width, Side side = Side::Left, const sgc::Colorf& bg = sgc::Colorf{0.12f, 0.12f, 0.15f, 1.0f})
void drawButtonRow(const std::vector<std::string>& labels, float y, float height, const LayoutButtonStyle& style, const int* selectedIndex = nullptr)
void drawPanelGrid(int rows, int cols, float gap, std::function<void(Screen&, sgc::Rectf, int, int)> drawCell)
void drawScrollList(const std::vector<std::string>& items, float x, float y, float w, float h, int* scrollPos, int* selectedIndex)
void drawLabeledField(float x, float y, float labelW, float fieldW, float height, std::string_view label, std::string_view value)
void drawForm(const sgc::Rectf& area, const std::vector<FormField>& fields, float rowHeight = 30.0f)
void drawStatusBar(const std::map<std::string, std::string>& items, float height = 24.0f)
void drawProgressBar(const sgc::Rectf& rect, float progress, std::string_view label = "")
[[nodiscard]] sgc::Rectf drawTabBar(const std::vector<TabDef>& tabs, int* activeTab, float y, float height = 32.0f)
inline void drawProgressBar(Screen& screen, float x, float y, float w, float h, float progress, const sgc::Colorf& fillColor = {0.3f, 0.8f, 0.4f, 1}, const sgc::Colorf& bgColor = {0.2f, 0.2f, 0.2f, 0.8f})
inline void drawButton(Screen& screen, float x, float y, float w, float h, const std::string& text, const sgc::Colorf& bg = {0.3f, 0.3f, 0.4f, 0.9f}, const sgc::Colorf& textColor = {1, 1, 1, 1})
inline void drawLabelValue(Screen& screen, float x, float y, float w, float h, const std::string& label, const std::string& value, const sgc::Colorf& labelColor = {0.7f, 0.7f, 0.8f, 1}, const sgc::Colorf& valueColor = {1, 1, 1, 1})
inline void drawStarRating(Screen& screen, float x, float y, float w, float h, int rating, int maxStars = 5, const sgc::Colorf& filledColor = {1, 0.85f, 0.2f, 1}, const sgc::Colorf& emptyColor = {0.4f, 0.4f, 0.4f, 1})
inline void drawTooltip(Screen& screen, float x, float y, const std::string& text, const sgc::Colorf& bg = {0.1f, 0.1f, 0.15f, 0.95f})
inline void drawNotification(Screen& screen, float screenW, const std::string& text, float progress = 1.0f, const sgc::Colorf& bg = {0.2f, 0.5f, 0.3f, 0.9f})
struct ScrollBarStyle 6
float width = 6.0f
float minThumbLength = 20.0f
float cornerRadius = 3.0f
bool autoHide = true
float fadeDelaySec = 1.5f
float opacity = 0.5f
struct ScrollViewConfig 14
float contentHeight = 0.0f
float contentWidth = 0.0f
bool verticalScroll = true
bool horizontalScroll = false
bool bounceEffect = true
bool snapToItem = false
float snapItemHeight = 0.0f
float inertiaDamping = 0.92f
float bounceDamping = 0.6f
float wheelMultiplier = 40.0f
float keyboardScrollAmount = 40.0f
ScrollBarStyle scrollBar
bool virtualScrolling = false
float virtualItemHeight = 0.0f
struct VirtualScrollRange 3
std::size_t firstVisible = 0
std::size_t lastVisible = 0
float offsetY = 0.0f
class ScrollView 37
explicit ScrollView(ScrollViewConfig config = {}) noexcept
[[nodiscard]] const sgc::Rectf& viewport() const noexcept
void setViewport(const sgc::Rectf& vp) noexcept
[[nodiscard]] float scrollY() const noexcept
[[nodiscard]] float scrollX() const noexcept
[[nodiscard]] float contentHeight() const noexcept
[[nodiscard]] float contentWidth() const noexcept
void setContentHeight(float h) noexcept
void setContentWidth(float w) noexcept
[[nodiscard]] const ScrollViewConfig& config() const noexcept
void setConfig(const ScrollViewConfig& cfg) noexcept
[[nodiscard]] float maxScrollY() const noexcept
[[nodiscard]] float maxScrollX() const noexcept
[[nodiscard]] bool canScrollVertically() const noexcept
[[nodiscard]] bool canScrollHorizontally() const noexcept
[[nodiscard]] float normalizedScrollY() const noexcept
[[nodiscard]] float normalizedScrollX() const noexcept
[[nodiscard]] bool containsPoint(float x, float y) const noexcept
[[nodiscard]] bool isDragging() const noexcept
[[nodiscard]] bool isScrolling() const noexcept
void setScrollY(float y) noexcept
void setScrollX(float x) noexcept
void scrollToTop() noexcept
void scrollToBottom() noexcept
void ensureVisible(float itemTop, float itemHeight) noexcept
void onMouseWheel(float delta)
void onMouseWheelH(float delta)
void onKeyboardScroll(float deltaX, float deltaY, bool pageScroll = false)
void onDragBegin(float screenX, float screenY)
void onDragMove(float screenX, float screenY)
void onDragEnd(float velocityX = 0.0f, float velocityY = 0.0f)
[[nodiscard]] VirtualScrollRange computeVisibleRange( std::size_t totalItems) const noexcept
void applyToChildren(UINode& parent) const
void update(float dt)
[[nodiscard]] bool isScrollBarVisible() const noexcept
[[nodiscard]] float scrollBarOpacity() const noexcept
[[nodiscard]] sgc::Rectf scrollBarThumbRect() const noexcept
enum AnchorPreset : std::uint8_t 12
TopLeft
TopCenter
TopRight
CenterLeft
Center
CenterRight
BottomLeft
BottomCenter
BottomRight
StretchHorizontal
StretchVertical
StretchAll
struct UIAnchorConfig 10
AnchorPreset preset = AnchorPreset::TopLeft
float marginLeft = 0.0f
float marginRight = 0.0f
float marginTop = 0.0f
float marginBottom = 0.0f
float pivotX = 0.0f
float pivotY = 0.0f
bool keepAspectRatio = false
[[nodiscard]] static UIAnchorConfig uniform(AnchorPreset preset, float margin) noexcept
[[nodiscard]] UIAnchorConfig withCenterPivot() const noexcept
struct UIResolvedBounds 3
UINodeId nodeId = 0
sgc::Rectf bounds
int zOrder = 0
struct UIAnchorEntry 6
UINode* node = nullptr
UIAnchorConfig config
UINode* parentNode = nullptr
float elementW = 0.0f
float elementH = 0.0f
int zOrder = 100
class UIAnchorLayout 6
void setAnchor(UINode& node, const UIAnchorConfig& config, float elementW = 0.0f, float elementH = 0.0f, int zOrder = 100)
void setAnchorRelative(UINode& node, UINode& parent, const UIAnchorConfig& config, float elementW = 0.0f, float elementH = 0.0f, int zOrder = 100)
void removeAnchor(UINodeId nodeId)
[[nodiscard]] std::vector<UIResolvedBounds> resolve(float screenW, float screenH)
[[nodiscard]] std::size_t count() const noexcept
void clear()
enum UIAnimationType : std::uint8_t 10
FadeIn
FadeOut
SlideLeft
SlideRight
SlideUp
SlideDown
ScaleIn
ScaleOut
Bounce
Pulse
struct UIAnimation 7
UIAnimationType type = UIAnimationType::FadeIn
float duration = 0.3f
float delay = 0.0f
vn::EasingType easing = vn::EasingType::EaseOutCubic
bool loop = false
bool pingPong = false
float slideDistance = 100.0f
struct UIAnimationTransform 8
float offsetX = 0.0f
float offsetY = 0.0f
float scaleX = 1.0f
float scaleY = 1.0f
float alpha = 1.0f
float rotation = 0.0f
[[nodiscard]] UIAnimationTransform compose(const UIAnimationTransform& other) const noexcept
[[nodiscard]] bool isIdentity() const noexcept
struct UIAnimationState 5
UIAnimation animation
float elapsed = 0.0f
float progress = 0.0f
bool finished = false
bool forward = true
class UIAnimator 8
void animate(UINodeId nodeId, const UIAnimation& animation)
void update(float dt)
[[nodiscard]] UIAnimationTransform getTransform(UINodeId nodeId) const
[[nodiscard]] bool isAnimating(UINodeId nodeId) const
void cancelAnimation(UINodeId nodeId)
void cancelAll()
[[nodiscard]] std::size_t activeCount() const noexcept
[[nodiscard]] const std::vector<UIAnimationState>& getStates(UINodeId nodeId) const
class UIBuilder 32
UIBuilder(float screenW, float screenH) noexcept
UIBuilder& padding(float p) noexcept
UIBuilder& padding(float h, float v) noexcept
UIBuilder& padding(float top, float right, float bottom, float left) noexcept
UIBuilder& margin(float m) noexcept
UIBuilder& area(const sgc::Rectf& rect) noexcept
[[nodiscard]] sgc::Rectf workingArea() const noexcept
[[nodiscard]] RowResult row(int count, float height = 40.0f, float gap = 8.0f) const
[[nodiscard]] RowResult row(const std::vector<float>& widths, float height = 40.0f, float gap = 8.0f) const
[[nodiscard]] ColResult column(int count, float itemHeight = 40.0f, float gap = 8.0f) const
[[nodiscard]] GridResult grid(int rows, int cols, float gap = 8.0f) const
[[nodiscard]] sgc::Rectf centered(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf centeredHorizontally(float w, float h, float y) const noexcept
[[nodiscard]] sgc::Rectf centeredVertically(float w, float h, float x) const noexcept
[[nodiscard]] sgc::Rectf topLeft(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf topCenter(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf topRight(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf bottomLeft(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf bottomCenter(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf bottomRight(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf left(float w, float h) const noexcept
[[nodiscard]] sgc::Rectf right(float w, float h) const noexcept
[[nodiscard]] SplitResult splitHorizontal(float ratio = 0.5f, float gap = 8.0f) const noexcept
[[nodiscard]] VSplitResult splitVertical(float ratio = 0.5f, float gap = 8.0f) const noexcept
UIBuilder& beginStack(float x, float y, float width) noexcept
[[nodiscard]] sgc::Rectf stackItem(float height, float gap = 4.0f) noexcept
[[nodiscard]] float stackY() const noexcept
[[nodiscard]] bool isMobile() const noexcept
[[nodiscard]] bool isTablet() const noexcept
[[nodiscard]] bool isDesktop() const noexcept
[[nodiscard]] float scale() const noexcept
[[nodiscard]] int columns() const noexcept
enum UIBindProperty : std::uint8_t 15
Text
Value
Visible
Color
Enabled
PositionX
PositionY
SizeW
SizeH
using UIBindValue = std::variant<std::string, float, bool, int>;
[[nodiscard]] inline std::string valueToString(const UIBindValue& v)
[[nodiscard]] inline float valueToFloat(const UIBindValue& v)
[[nodiscard]] inline bool valueToBool(const UIBindValue& v)
inline void applyToNode(UINode& node, UIBindProperty prop, const UIBindValue& value)
[[nodiscard]] inline UIBindValue readFromNode(const UINode& node, UIBindProperty prop)
struct UIBindingEntry 3
std::string key
UINode* node = nullptr
UIBindValue lastValue
struct UITwoWayBindingEntry 4
UINode* nodeA = nullptr
UINode* nodeB = nullptr
UIBindValue lastValueA
UIBindValue lastValueB
struct UIExpressionBindingEntry 2
UINode* node = nullptr
std::string formatExpr
struct UIListBindingEntry 4
UINode* listNode = nullptr
std::string dataKey
std::size_t lastCount = 0
std::function<std::shared_ptr<UINode>(std::size_t)> factory
class UIBindingContext 12
void set(const std::string& key, UIBindValue value)
template <typename T> [[nodiscard]] T get(const std::string& key) const
void setArray(const std::string& key, std::vector<UIBindValue> data)
[[nodiscard]] const std::vector<UIBindValue>& getArray(const std::string& key) const
void bind(const std::string& key, UINode& node, UIBindProperty property)
void bindOneWay(UINode& source, UIBindProperty sourceProp, UINode& target, UIBindProperty targetProp)
void bindTwoWay(UINode& nodeA, UIBindProperty propA, UINode& nodeB, UIBindProperty propB)
void bindExpression(UINode& node, UIBindProperty property, const std::string& formatExpr)
void bindList(UINode& listNode, const std::string& dataKey, std::function<std::shared_ptr<UINode>(std::size_t)> factory)
void update()
void clear()
[[nodiscard]] std::size_t bindingCount() const noexcept
enum DropResultType : std::uint8_t 4
Accepted
Rejected
Cancelled
NoTarget
enum DropZoneHighlight : std::uint8_t 4
None
Valid
Invalid
using DropCallback = std::function<bool(const DragPayload&)>;
struct DragPayload 4
std::string type
std::variant<int, float, std::string> data
UINodeId sourceNodeId = INVALID_UI_NODE
std::string icon
struct DropResult 2
DropResultType type = DropResultType::NoTarget
UINodeId targetNodeId = INVALID_UI_NODE
struct DropTarget 4
UINodeId nodeId = INVALID_UI_NODE
std::vector<std::string> acceptedTypes
DropCallback onDrop
sgc::Rectf bounds
struct DragRenderInfo 4
bool active = false
float mouseX = 0.0f, mouseY = 0.0f
std::string icon, payloadType
UINodeId sourceNodeId = INVALID_UI_NODE
struct DropZoneRenderInfo 3
UINodeId nodeId = INVALID_UI_NODE
sgc::Rectf bounds
DropZoneHighlight highlight = DropZoneHighlight::None
class UIDragDropManager 18
void beginDrag(const DragPayload& payload, float mx, float my)
void updateDrag(float mx, float my)
[[nodiscard]] DropResult endDrag(float mx, float my)
[[nodiscard]] DropResult cancelDrag()
[[nodiscard]] bool isDragging() const noexcept
[[nodiscard]] const DragPayload& currentPayload() const noexcept
[[nodiscard]] float mouseX() const noexcept
[[nodiscard]] float mouseY() const noexcept
[[nodiscard]] float startX() const noexcept
[[nodiscard]] float startY() const noexcept
[[nodiscard]] UINodeId hoveredTarget() const noexcept
[[nodiscard]] std::size_t targetCount() const noexcept
void registerDropTarget(UINodeId nodeId, std::vector<std::string> types, DropCallback onDrop, const sgc::Rectf& bounds)
void unregisterDropTarget(UINodeId nodeId)
void updateTargetBounds(UINodeId nodeId, const sgc::Rectf& bounds)
void clearTargets()
[[nodiscard]] DragRenderInfo dragRenderInfo() const
[[nodiscard]] std::vector<DropZoneRenderInfo> dropZoneRenderInfo() const
enum UIEventType : std::uint8_t 20
Click
DoubleClick
Press
Release
Hover
HoverEnter
HoverLeave
Focus
Blur
ValueChanged
TextChanged
DragStart
Drag
DragEnd
Scroll
KeyDown
KeyUp
TextInput
using UIEventHandler = std::function<void(UIEvent&)>;
using UIEventHandlerId = std::uint64_t;
struct UIEvent 10
UINodeId targetId = INVALID_UI_NODE
float mouseX = 0.0f
float mouseY = 0.0f
int button = 0
int keyCode = 0
std::string text
float deltaX = 0.0f
float deltaY = 0.0f
double timestamp = 0.0
bool consumed = false
class UIEventDispatcher 5
[[nodiscard]] UIEventHandlerId addEventListener( UINodeId nodeId, UIEventType eventType, UIEventHandler handler) noexcept
[[nodiscard]] UIEventHandlerId addCaptureListener( UINodeId nodeId, UIEventType eventType, UIEventHandler handler) noexcept
void removeEventListener(UIEventHandlerId handlerId) noexcept
void dispatch(UINode& root, UIEvent& event) const
[[nodiscard]] std::size_t handlerCount() const noexcept
enum UIEventType : std::uint8_t 7
ValueChanged
TextChanged
VisibilityChanged
Created
Destroyed
Pressed
BoundsChanged
struct UIEvent 8
UIEventType type
UINodeId nodeId
std::string nodeName
UIRole nodeRole
std::uint64_t frame
std::string oldValue
std::string newValue
[[nodiscard]] std::string toJson() const
class UIEventLog 10
void setMaxEvents(std::size_t max)
void record(UIEvent event)
void clear()
[[nodiscard]] const std::vector<UIEvent>& events() const noexcept
[[nodiscard]] std::vector<UIEvent> eventsForNode(UINodeId id) const
[[nodiscard]] std::vector<UIEvent> eventsSinceFrame(std::uint64_t frame) const
[[nodiscard]] std::vector<UIEvent> eventsByType(UIEventType type) const
[[nodiscard]] std::size_t eventCount() const noexcept
[[nodiscard]] std::string toJson() const
[[nodiscard]] std::string toJson(const std::vector<UIEvent>& events) const
enum UIEventPhase : std::uint8_t 4
None
Capture
Target
Bubble
enum MouseEventType : std::uint8_t 4
Press
Release
Move
Scroll
enum KeyEventType : std::uint8_t 6
KeyDown
KeyUp
using MouseEventHandler = std::function<void(UIMouseEvent&)>;
using KeyEventHandler = std::function<void(UIKeyEvent&)>;
using FocusEventHandler = std::function<void(UIFocusEvent&)>;
using ListenerId = std::uint64_t;
struct UIMouseEvent 11
float x = 0.0f
float y = 0.0f
int button = 0
int clickCount = 1
UINodeId targetId = INVALID_UI_NODE
UIEventPhase phase = UIEventPhase::None
bool propagationStopped = false
bool defaultPrevented = false
double timestamp = 0.0
void stopPropagation() noexcept
void preventDefault() noexcept
struct UIKeyEvent 9
int key = 0
int modifiers = 0
UINodeId targetId = INVALID_UI_NODE
UIEventPhase phase = UIEventPhase::None
bool propagationStopped = false
bool defaultPrevented = false
double timestamp = 0.0
void stopPropagation() noexcept
void preventDefault() noexcept
struct UIFocusEvent 6
UINodeId targetId = INVALID_UI_NODE
UINodeId relatedTargetId = INVALID_UI_NODE
UIEventPhase phase = UIEventPhase::None
bool propagationStopped = false
double timestamp = 0.0
void stopPropagation() noexcept
class UIEventProcessor 10
[[nodiscard]] ListenerId addMouseListener(UINodeId nodeId, MouseEventType type, MouseEventHandler handler, bool useCapture = false)
[[nodiscard]] ListenerId addKeyListener(UINodeId nodeId, KeyEventType type, KeyEventHandler handler, bool useCapture = false)
[[nodiscard]] ListenerId addFocusListener(UINodeId nodeId, bool isFocusIn, FocusEventHandler handler)
void removeEventListener(ListenerId lid)
bool processMouseEvent(UINode& root, float x, float y, MouseEventType type, int button = 0, double timestamp = 0.0)
bool processKeyEvent(UINode& focusedNode, int key, KeyEventType type, int modifiers = 0, double timestamp = 0.0)
void processFocusChange(UINode* oldNode, UINode* newNode, double timestamp = 0.0)
[[nodiscard]] std::size_t listenerCount() const noexcept
[[nodiscard]] inline bool isRoleFocusable(UIRole role) noexcept
inline void buildFocusOrderImpl(UINode& node, std::vector<UINode*>& order)
class UIFocusManager 15
void setFocusedNode(UINode* node) noexcept
[[nodiscard]] UINode* getFocusedNode() const noexcept
void clearFocus() noexcept
[[nodiscard]] bool isFocused(UINodeId nodeId) const noexcept
[[nodiscard]] std::vector<UINode*> buildFocusOrder(UINode& root) const
void focusNext(UINode& root)
void focusPrevious(UINode& root)
[[nodiscard]] inline bool isPointInBounds(const UINode& node, float x, float y) noexcept
inline void hitTestAllImpl(UINode& node, float x, float y, std::vector<UINode*>& results)
[[nodiscard]] inline UINode* hitTest(UINode& root, float x, float y)
[[nodiscard]] inline std::vector<UINode*> hitTestAll(UINode& root, float x, float y)
[[nodiscard]] inline NineSliceRegions computeNineSliceRegions( const UINineSliceConfig& config, const sgc::Rectf& dest) noexcept
inline void drawNineSliceToBatch( render::SpriteBatch& batch, const UINineSliceConfig& config, const sgc::Rectf& dest, const sgc::Colorf& tint)
inline void drawNineSlice( render::SpriteBatch& batch, const render::Texture& texture, const UINineSliceConfig& config, const sgc::Rectf& dest, float alpha = 1.0f)
[[nodiscard]] inline sgc::Rectf nineSliceMinimumSize(const UINineSliceConfig& config) noexcept
struct NineSliceRegions 2
sgc::Rectf destRects[9]
sgc::Rectf uvRects[9]
enum UIRole : std::uint8_t 22
Container
Label
Button
ProgressBar
Image
HealthBar
ScoreLabel
MiniMap
Inventory
DialogBox
MenuItem
Tooltip
Panel
Slider
Toggle
TextInput
Dropdown
ListView
TabBar
Custom
using UINodeId = std::uint32_t;
inline constexpr UINodeId INVALID_UI_NODE = 0
struct UINodeData 8
UINodeId id = INVALID_UI_NODE
std::string name
UIRole role = UIRole::Container
std::string text
float value = 0.0f
float maxValue = 1.0f
bool visible = true
std::map<std::string, std::string> properties
class UINode 34
explicit UINode(UINodeData data)
[[nodiscard]] UINodeId id() const noexcept
[[nodiscard]] const std::string& name() const noexcept
[[nodiscard]] UIRole role() const noexcept
[[nodiscard]] const sgc::Rectf& bounds() const noexcept
[[nodiscard]] const std::string& text() const noexcept
[[nodiscard]] float value() const noexcept
[[nodiscard]] float maxValue() const noexcept
[[nodiscard]] const sgc::Colorf& color() const noexcept
[[nodiscard]] bool visible() const noexcept
[[nodiscard]] const UINodeData& data() const noexcept
[[nodiscard]] bool focusable() const noexcept
[[nodiscard]] bool hitTestEnabled() const noexcept
[[nodiscard]] int zIndex() const noexcept
[[nodiscard]] bool interactable() const noexcept
void setBounds(const sgc::Rectf& bounds)
void setText(const std::string& text)
void setValue(float value)
void setVisible(bool visible)
void setFocusable(bool focusable) noexcept
void setHitTestEnabled(bool enabled) noexcept
void setZIndex(int zIndex) noexcept
void setInteractable(bool interactable) noexcept
void setProperty(const std::string& key, const std::string& value)
[[nodiscard]] std::string getProperty(std::string_view key) const
void addChild(std::shared_ptr<UINode> child)
void removeChild(UINodeId childId)
[[nodiscard]] const std::vector<std::shared_ptr<UINode>>& children() const noexcept
[[nodiscard]] std::size_t childCount() const noexcept
[[nodiscard]] UINode* parent() const noexcept
[[nodiscard]] UINode* findById(UINodeId id)
[[nodiscard]] UINode* findByName(std::string_view name)
[[nodiscard]] std::vector<const UINode*> findByRole(UIRole role) const
[[nodiscard]] std::string toJson() const
enum NotificationType : std::uint8_t 5
Info
Success
Warning
Error
Achievement
enum NotificationPosition : std::uint8_t 6
TopRight
TopLeft
BottomRight
BottomLeft
TopCenter
BottomCenter
struct NotificationAction 2
std::string label
std::function<void()> onClick
struct UINotification 6
NotificationType type = NotificationType::Info
std::string title, message, icon
float duration = 5.0f
std::vector<NotificationAction> actions
std::function<void()> onClick
std::function<float()> getProgress
struct NotificationQueueConfig 6
NotificationPosition position = NotificationPosition::TopRight
int maxVisible = 5
float width = 350.0f, minHeight = 60.0f, spacing = 8.0f
float marginX = 16.0f, marginY = 16.0f
float slideInDuration = 0.25f, slideOutDuration = 0.2f
float screenWidth = 1920.0f, screenHeight = 1080.0f
struct NotificationRenderInfo 6
std::uint32_t id = 0
NotificationType type = NotificationType::Info
std::string title, message, icon
sgc::Rectf bounds
float opacity = 1.0f, slideOffset = 0.0f, progress = -1.0f
std::vector<std::string> actionLabels
class UINotificationQueue 23
explicit UINotificationQueue(const NotificationQueueConfig& cfg = {})
void setScreenBounds(float w, float h) noexcept
void setOnDismissed(std::function<void(std::uint32_t)> cb)
[[nodiscard]] const NotificationQueueConfig& config() const noexcept
std::uint32_t push(const UINotification& n)
std::uint32_t pushInfo(const std::string& t, const std::string& m)
std::uint32_t pushSuccess(const std::string& t, const std::string& m)
std::uint32_t pushWarning(const std::string& t, const std::string& m)
std::uint32_t pushError(const std::string& t, const std::string& m)
std::uint32_t pushWithProgress(const std::string& title, std::function<float()> gp)
void dismiss(std::uint32_t id)
void dismissAll()
void setNotificationHeight(std::uint32_t id, float h)
[[nodiscard]] std::size_t visibleCount() const noexcept
[[nodiscard]] std::size_t pendingCount() const noexcept
[[nodiscard]] std::size_t totalCount() const noexcept
[[nodiscard]] std::vector<NotificationRenderInfo> getVisible() const
void update(float dt)
inline void skipWS(const std::string& s, std::size_t& p) noexcept
[[nodiscard]] inline std::string readStr(const std::string& s, std::size_t& p)
[[nodiscard]] inline float readNum(const std::string& s, std::size_t& p)
inline void skipVal(const std::string& s, std::size_t& p)
[[nodiscard]] inline sgc::Colorf parseHexColor(const std::string& hex)
struct UIPrefabNodeDef 10
std::string type
std::string name
std::string text
float value = 0.0f, maxValue = 1.0f
float width = 0.0f, height = 0.0f
std::string onClick
std::string backgroundColor
float cornerRadius = 0.0f
std::unordered_map<std::string, std::string> bindDefs
std::vector<UIPrefabNodeDef> children
class UIPrefab 5
[[nodiscard]] static UIPrefab loadFromJson(const std::string& jsonStr)
explicit UIPrefab(UIPrefabNodeDef root)
[[nodiscard]] std::shared_ptr<UINode> instantiate() const
[[nodiscard]] std::shared_ptr<UINode> instantiateWithBindings(UIBindingContext& ctx) const
[[nodiscard]] const UIPrefabNodeDef& rootDef() const noexcept
class UIStateManager 4
void setState(UINodeId nodeId, UIVisualState state)
[[nodiscard]] UIVisualState getState(UINodeId nodeId) const
void clearState(UINodeId nodeId)
void clearAll()
class UIRenderer 4
void setTextureCache(const std::map<std::string, render::Texture>& cache)
void addTexture(const std::string& key, const render::Texture& texture)
void render(Screen& screen, const UINode& root, const UIStyleSheet& sheet, const UIStateManager& stateManager, const UIAnimator* animator = nullptr) const
void renderNode(Screen& screen, const UINode& node, const UIBoxStyle& boxStyle, const UITextStyle& textStyle, UIVisualState state, const UIAnimationTransform* animTransform = nullptr, const UIWidgetMetrics* metrics = nullptr) const
struct RichTextSegment 6
std::string text
bool bold = false
bool italic = false
float fontSize = 16.0f
std::string link
std::string emoji
struct RichTextMeasurement 3
float width = 0.0f
float height = 0.0f
int lineCount = 0
class UIRichText 7
void setDefaultFontSize(float s) noexcept
void setDefaultColor(const sgc::Colorf& c) noexcept
[[nodiscard]] float defaultFontSize() const noexcept
[[nodiscard]] const sgc::Colorf& defaultColor() const noexcept
[[nodiscard]] std::vector<RichTextSegment> parse(std::string_view markup) const
[[nodiscard]] RichTextMeasurement measure(const std::vector<RichTextSegment>& segs, float maxW) const noexcept
template <typename ScreenT> void render(ScreenT& screen, const std::vector<RichTextSegment>& segs, const sgc::Rectf& rect) const
enum SmartTooltipPosition : std::uint8_t 5
Auto
Above
Below
Left
Right
enum TooltipContentType : std::uint8_t 4
PlainText
RichText
Custom
using TooltipDrawCallback = std::function<void(const sgc::Rectf&, float)>;
struct SmartTooltipConfig 7
float showDelay = 0.4f, hideDelay = 0.15f
float maxWidth = 320.0f, padding = 10.0f, arrowSize = 8.0f
SmartTooltipPosition position = SmartTooltipPosition::Auto
bool arrowEnabled = true, followMouse = false, pinnable = false
float fadeInDuration = 0.12f, fadeOutDuration = 0.08f
float screenMargin = 6.0f, screenWidth = 1920.0f, screenHeight = 1080.0f
UIBoxStyle panelStyle
class SmartTooltip 22
explicit SmartTooltip(const SmartTooltipConfig& cfg = {})
[[nodiscard]] bool isVisible() const noexcept
[[nodiscard]] float opacity() const noexcept
[[nodiscard]] bool isPinned() const noexcept
[[nodiscard]] const sgc::Rectf& bounds() const noexcept
[[nodiscard]] SmartTooltipPosition resolvedPosition() const noexcept
[[nodiscard]] const std::string& text() const noexcept
[[nodiscard]] TooltipContentType contentType() const noexcept
[[nodiscard]] const SmartTooltipConfig& config() const noexcept
[[nodiscard]] bool arrowEnabled() const noexcept
[[nodiscard]] const TooltipDrawCallback& drawCallback() const noexcept
void setScreenBounds(float w, float h) noexcept
void setConfig(const SmartTooltipConfig& c)
void setContentSize(float w, float h) noexcept
void show(const std::string& text, const sgc::Rectf& anchor)
void showRich(const std::string& richText, const sgc::Rectf& anchor)
void showCustom(TooltipDrawCallback cb, const sgc::Rectf& anchor)
void hide()
void hideImmediate()
void togglePin()
void updateMousePosition(float x, float y) noexcept
void update(float dt)
class SmartTooltipGroup 7
void add(const std::string& key, const SmartTooltipConfig& cfg = {})
void show(const std::string& key, const std::string& text, const sgc::Rectf& anchor)
void hideActive()
void update(float dt)
[[nodiscard]] SmartTooltip* get(const std::string& key)
[[nodiscard]] const std::string& activeKey() const noexcept
[[nodiscard]] std::size_t size() const noexcept
struct UIElementInfo 9
UINodeId id = INVALID_UI_NODE
std::string name
UIRole role = UIRole::Container
std::string text
float value = 0.0f
float maxValue = 1.0f
bool visible = true
std::vector<UIElementInfo> children
[[nodiscard]] std::string toJson() const
class UISnapshot 4
[[nodiscard]] static UIElementInfo capture(const UINode& root)
[[nodiscard]] static std::vector<UIElementInfo> flatten(const UINode& root)
[[nodiscard]] static std::string toJson(const UINode& root)
[[nodiscard]] static std::string toSummaryJson(const UINode& root)
enum UIVisualState : std::uint8_t 6
Normal
Hovered
Pressed
Focused
Disabled
Active
struct UIDragState 5
bool dragging = false
float startX = 0.0f
float startY = 0.0f
float currentX = 0.0f
float currentY = 0.0f
struct UIInteractiveState 9
UIVisualState visualState = UIVisualState::Normal
bool hovered = false
bool pressed = false
bool focused = false
bool disabled = false
UIDragState dragState
float value = 0.0f
bool checked = false
std::string text
class UIStateManager 6
void processInput(UINode& root, const InputState& input, UIEventDispatcher& dispatcher)
[[nodiscard]] UIInteractiveState getState(UINodeId nodeId) const
void setState(UINodeId nodeId, const UIInteractiveState& state)
void setDisabled(UINodeId nodeId, bool disabled)
[[nodiscard]] UIFocusManager& focusManager() noexcept
[[nodiscard]] const UIFocusManager& focusManager() const noexcept
enum UIVisualState : std::uint8_t 5
Normal
Hovered
Pressed
Focused
Disabled
enum UIFontWeight : std::uint8_t 2
Normal
Bold
enum UITextAlign : std::uint8_t 3
Left
Center
Right
enum UIVerticalAlign : std::uint8_t 3
Top
Middle
Bottom
enum UITextOverflow : std::uint8_t 3
Visible
Hidden
Ellipsis
struct UIEdgeInsets 6
float top = 0.0f
float right = 0.0f
float bottom = 0.0f
float left = 0.0f
[[nodiscard]] static constexpr UIEdgeInsets uniform(float value) noexcept
[[nodiscard]] static constexpr UIEdgeInsets symmetric(float horizontal, float vertical) noexcept
struct UIOffset 2
float x = 0.0f
float y = 0.0f
struct UINineSliceConfig 10
std::uint32_t textureId = 0
float cornerW = 16.0f
float cornerH = 16.0f
float edgeInsetLeft = 16.0f
float edgeInsetRight = 16.0f
float edgeInsetTop = 16.0f
float edgeInsetBottom = 16.0f
float textureW = 64.0f
float textureH = 64.0f
[[nodiscard]] static UINineSliceConfig uniform( std::uint32_t texId, float corner, float texW, float texH) noexcept
struct UIWidgetMetrics 19
float sliderTrackHeightRatio = 0.3f
float sliderTrackMinHeight = 4.0f
float sliderHandleRadiusRatio = 0.4f
float toggleBoxSize = 20.0f
float toggleInnerMargin = 3.0f
float toggleLabelGap = 8.0f
float dropdownArrowSize = 8.0f
float dropdownArrowSpace = 20.0f
float textInputCursorWidth = 2.0f
float textInputCursorMarginX = 2.0f
float textInputCursorMarginY = 2.0f
float textInputTextOffsetX = 4.0f
std::string sliderHandleImageKey
std::string sliderFillImageKey
std::string toggleOnImageKey
std::string toggleOffImageKey
std::string progressFillImageKey
std::string dropdownArrowImageKey
std::string textInputCursorImageKey
struct UIBoxStyle 7
std::optional<std::string> backgroundImageKey
std::optional<UINineSliceConfig> backgroundNineSlice
float borderRadius = 0.0f
float shadowBlur = 0.0f
float opacity = 1.0f
[[nodiscard]] sgc::Rectf contentRect(const sgc::Rectf& bounds) const noexcept
[[nodiscard]] sgc::Rectf marginRect(const sgc::Rectf& bounds) const noexcept
struct UITextStyle 7
float fontSize = 16.0f
UIFontWeight fontWeight = UIFontWeight::Normal
UITextAlign textAlign = UITextAlign::Left
UIVerticalAlign verticalAlign = UIVerticalAlign::Top
float lineHeight = 1.2f
float letterSpacing = 0.0f
UITextOverflow overflow = UITextOverflow::Visible
struct UIBoxStyleOverride 8
std::optional<sgc::Colorf> backgroundColor
std::optional<sgc::Colorf> borderColor
std::optional<UIEdgeInsets> borderWidth
std::optional<float> borderRadius
std::optional<sgc::Colorf> shadowColor
std::optional<UIOffset> shadowOffset
std::optional<float> shadowBlur
std::optional<float> opacity
struct UITextStyleOverride 3
std::optional<sgc::Colorf> color
std::optional<float> fontSize
std::optional<UIFontWeight> fontWeight
struct UIStateStyles 12
UIBoxStyle boxStyle
UITextStyle textStyle
UIWidgetMetrics widgetMetrics
std::optional<UIBoxStyleOverride> hovered
std::optional<UIBoxStyleOverride> pressed
std::optional<UIBoxStyleOverride> focused
std::optional<UIBoxStyleOverride> disabled
std::optional<UITextStyleOverride> hoveredText
std::optional<UITextStyleOverride> pressedText
std::optional<UITextStyleOverride> focusedText
std::optional<UITextStyleOverride> disabledText
[[nodiscard]] Resolved resolve(UIVisualState state) const
class UIStyleSheet 9
void buildDefaults(const UITheme& theme)
void setStyle(UIRole role, const UIStateStyles& styles)
[[nodiscard]] const UIStateStyles& getStyle(UIRole role) const
void setClassStyle(const std::string& className, const UIStateStyles& styles)
[[nodiscard]] const UIStateStyles* getClassStyle(const std::string& className) const
[[nodiscard]] const UIStateStyles& resolveForNode(const UINode& node) const
[[nodiscard]] const std::map<UIRole, UIStateStyles>& roleStyles() const noexcept
[[nodiscard]] const std::map<std::string, UIStateStyles>& classStyles() const noexcept
[[nodiscard]] std::string toJson() const
class UITemplate 7
static std::shared_ptr<UINode> fromJson(const std::string& jsonTemplate)
static std::string toJson(const UINode& root)
static std::shared_ptr<UINode> createHUD(float screenW, float screenH)
static std::shared_ptr<UINode> createElement(const std::string& typeName, const std::string& name)
static UIRole roleFromString(const std::string& typeName)
static std::string roleToString(UIRole role)
static Anchor anchorFromString(const std::string& anchorName)
struct ThemeMetrics 8
float fontSize = 16.0f
float titleFontSize = 24.0f
float padding = 8.0f
float margin = 4.0f
float borderWidth = 1.0f
float barHeight = 20.0f
float buttonHeight = 32.0f
float cornerRadius = 4.0f
struct UIThemeStyle 5
sgc::Colorf background
sgc::Colorf foreground
sgc::Colorf border
float fontSize
float padding
class UITheme 13
UITheme() = default
explicit UITheme(ThemeColors colors, ThemeMetrics metrics = {})
const ThemeColors& colors() const noexcept
const ThemeMetrics& metrics() const noexcept
void setColors(const ThemeColors& colors)
void setMetrics(const ThemeMetrics& metrics)
UIThemeStyle styleFor(UIRole role) const
void setStyleFor(UIRole role, const UIThemeStyle& style)
static UITheme dark()
static UITheme light()
static UITheme cyberpunk()
static UITheme retro()
std::string toJson() const
struct UINodeProperties 9
float posX = 0.0f
float posY = 0.0f
float sizeW = 0.0f
float sizeH = 0.0f
float opacity = 1.0f
float scaleX = 1.0f
float scaleY = 1.0f
bool visible = true
[[nodiscard]] static UINodeProperties lerp( const UINodeProperties& a, const UINodeProperties& b, float t) noexcept
struct UIState 2
std::string name
std::unordered_map<UINodeId, UINodeProperties> nodeProperties
struct UITransitionDef 5
std::string fromState
std::string toState
float duration = 0.3f
vn::EasingType easing = vn::EasingType::EaseOutCubic
float perNodeDelay = 0.0f
struct UINodeTransitionState 6
UINodeId nodeId = 0
UINodeProperties from
UINodeProperties to
float delay = 0.0f
float elapsed = 0.0f
bool finished = false
struct UIActiveTransition 4
UITransitionDef def
std::vector<UINodeTransitionState> nodes
float totalElapsed = 0.0f
bool finished = false
class UIStateManager 10
void defineState(const std::string& name, std::unordered_map<UINodeId, UINodeProperties> nodeProperties)
void registerNode(UINode& node)
void registerNodes(const std::vector<UINode*>& nodes)
void transitionTo(const std::string& stateName, float duration = 0.3f, vn::EasingType easing = vn::EasingType::EaseOutCubic, float perNodeDelay = 0.0f)
void update(float dt)
[[nodiscard]] const std::string& getCurrentState() const noexcept
[[nodiscard]] bool isTransitioning() const noexcept
[[nodiscard]] std::size_t activeTransitionCount() const noexcept
[[nodiscard]] std::size_t stateCount() const noexcept
void applyStateImmediate(const std::string& stateName)
struct UIAccordionSection 5
std::string title
bool expanded = false
std::string headerImageKey
float contentHeight = 100.0f
std::string iconImageKey
struct UIAccordionConfig 17
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UIAccordionSection> sections
bool allowMultipleOpen = false
float headerHeight = 40.0f
std::string headerBackgroundImageKey
std::string headerHoverImageKey
std::string headerActiveImageKey
std::string expandIconImageKey
std::string collapseIconImageKey
std::string contentBackgroundImageKey
float animationDuration = 0.25f
float spacing = 0.0f
float padding = 8.0f
float fontSize = 14.0f
float headerFontSize = 16.0f
float width = 300.0f
class UIAccordion 10
explicit UIAccordion(const UIAccordionConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] std::size_t sectionCount() const noexcept
[[nodiscard]] bool isExpanded(std::size_t index) const noexcept
[[nodiscard]] float animProgress(std::size_t index) const noexcept
void setOnSectionToggled(std::function<void(std::size_t, bool)> callback)
void toggle(std::size_t index)
void expandAll()
void collapseAll()
void update(float dt)
enum AvatarStatus : std::uint8_t 5
None
Online
Offline
Away
Busy
struct UIAvatarConfig 16
UINodeId id = INVALID_UI_NODE
std::string name
float size = 48.0f
std::string imageKey
std::string fallbackText
float borderWidth = 2.0f
std::string borderColor = "cccccc"
std::string borderImageKey
AvatarStatus statusIndicator = AvatarStatus::None
std::string statusColor = "00ff00"
float statusSize = 12.0f
std::string statusPosition = "bottom_right"
std::string backgroundImageKey
bool clickable = false
float fallbackFontSize = 18.0f
std::string fallbackBackgroundColor = "888888"
class UIAvatar 14
explicit UIAvatar(const UIAvatarConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const std::string& imageKey() const noexcept
[[nodiscard]] const std::string& fallbackText() const noexcept
[[nodiscard]] AvatarStatus status() const noexcept
[[nodiscard]] bool hasImage() const noexcept
[[nodiscard]] bool isClickable() const noexcept
void setOnClick(std::function<void()> callback)
void setImage(const std::string& key)
void setStatus(AvatarStatus newStatus)
void setFallbackText(const std::string& text)
void onPointerEnter()
void onPointerLeave()
void onPointerUp()
enum BadgePosition : std::uint8_t 4
TopRight
TopLeft
BottomRight
BottomLeft
struct UIBadgeConfig 16
UINodeId id = INVALID_UI_NODE
std::string name
int maxCount = 99
float fontSize = 11.0f
float minSize = 20.0f
float padding = 4.0f
std::string backgroundImageKey
std::string textColor = "ffffff"
std::string backgroundColor = "ff0000"
BadgePosition position = BadgePosition::TopRight
float offsetX = 0.0f
float offsetY = 0.0f
bool pulseAnimation = true
bool hideWhenZero = true
float pulseDuration = 0.4f
float pulseScale = 1.3f
class UIBadge 10
explicit UIBadge(const UIBadgeConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] int getCount() const noexcept
[[nodiscard]] bool isVisible() const noexcept
[[nodiscard]] bool isPulsing() const noexcept
[[nodiscard]] std::string displayText() const
void setCount(int count)
void show()
void hide()
void update(float dt)
enum ButtonState : std::uint8_t 4
Normal
Hovered
Pressed
Disabled
struct UIButtonConfig 7
UINodeId id = INVALID_UI_NODE
std::string name
std::string text
float width = 120.0f
float height = 32.0f
bool enabled = true
bool toggleable = false
class UIButton 13
explicit UIButton(const UIButtonConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] ButtonState state() const noexcept
[[nodiscard]] bool isEnabled() const noexcept
[[nodiscard]] bool isToggled() const noexcept
[[nodiscard]] const std::string& text() const noexcept
void setOnClick(std::function<void()> callback)
void setEnabled(bool enabled)
void setText(const std::string& text)
void onPointerEnter()
void onPointerLeave()
void onPointerDown()
void onPointerUp()
struct UICardContent 5
std::string title
std::string description
std::string imageKey
std::vector<std::string> tags
std::vector<std::string> actionLabels
struct UICardConfig 22
UINodeId id = INVALID_UI_NODE
std::string name
float width = 280.0f
float imageHeight = 160.0f
float padding = 12.0f
float titleFontSize = 18.0f
float descFontSize = 13.0f
std::string backgroundImageKey
std::string imageKey
std::string hoverImageKey
float borderRadius = 8.0f
float shadowOffsetX = 0.0f
float shadowOffsetY = 2.0f
float shadowBlur = 8.0f
std::string shadowColor = "00000040"
float elevation = 1.0f
float hoverElevation = 3.0f
float actionBarHeight = 36.0f
std::string actionBarImageKey
float tagFontSize = 11.0f
float tagHeight = 20.0f
float tagSpacing = 4.0f
class UICard 12
explicit UICard(const UICardConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const UICardContent& content() const noexcept
[[nodiscard]] bool isHovered() const noexcept
void setOnClicked(std::function<void()> callback)
void setOnActionClicked(std::function<void(std::size_t)> callback)
void setContent(const UICardContent& newContent)
void update(bool pointerInside, bool pointerPressed)
void onActionClick(std::size_t actionIndex)
void onPointerEnter()
void onPointerLeave()
void onPointerUp()
struct UICarouselItem 3
std::string imageKey
std::string title
std::string description
struct UICarouselConfig 22
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UICarouselItem> items
int visibleItems = 3
float itemWidth = 200.0f
float itemHeight = 250.0f
float spacing = 16.0f
float centerScale = 1.2f
float sideScale = 0.8f
float sideAlpha = 0.6f
bool autoPlay = false
float autoPlayInterval = 3.0f
bool showDots = true
bool showArrows = true
std::string arrowLeftImageKey
std::string arrowRightImageKey
std::string dotImageKey
std::string dotActiveImageKey
std::string backgroundImageKey
float animationDuration = 0.3f
float swipeThreshold = 50.0f
bool loopEnabled = true
class UICarousel 14
explicit UICarousel(const UICarouselConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] int currentIndex() const noexcept
[[nodiscard]] std::size_t itemCount() const noexcept
[[nodiscard]] bool isAnimating() const noexcept
void setOnItemChanged(std::function<void(int)> callback)
void setAutoPlay(bool enabled)
void next()
void previous()
void goTo(int index)
void onSwipeBegin()
void onSwipeUpdate(float deltaX)
void onSwipeEnd()
void update(float dt)
struct UIChatMessage 5
std::string sender
std::string text
double timestamp = 0.0
std::string channel
std::string iconImageKey
struct UIChatChannel 3
std::string name
std::string iconImageKey
bool enabled = true
struct UIChatScrollBarStyle 4
float width = 8.0f
float minThumbHeight = 20.0f
std::string trackImageKey
std::string thumbImageKey
struct UIChatWindowConfig 16
float width = 400.0f
float height = 300.0f
std::size_t maxMessages = 200
float inputHeight = 28.0f
std::string backgroundImageKey
std::string inputBackgroundImageKey
float channelTabHeight = 24.0f
std::string channelTabImageKey
UIChatScrollBarStyle scrollBarStyle
float messagePadding = 4.0f
float messageFontSize = 14.0f
float senderFontSize = 14.0f
float timestampFontSize = 11.0f
bool showTimestamps = true
bool showSenderIcon = true
std::size_t inputHistorySize = 32
class UIChatWindow 26
explicit UIChatWindow(const UIChatWindowConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const UIChatWindowConfig& config() const noexcept
void addMessage(UIChatMessage msg)
[[nodiscard]] const std::deque<UIChatMessage>& messages() const noexcept
[[nodiscard]] std::vector<const UIChatMessage*> filteredMessages() const
[[nodiscard]] std::size_t messageCount() const noexcept
void clearMessages()
void setInput(const std::string& text)
[[nodiscard]] const std::string& getInput() const noexcept
void clearInput()
void submitInput()
void inputHistoryUp()
void inputHistoryDown()
void addChannel(UIChatChannel channel)
void setActiveChannel(const std::string& name)
[[nodiscard]] const std::string& activeChannel() const noexcept
[[nodiscard]] const std::vector<UIChatChannel>& channels() const noexcept
void setChannelEnabled(const std::string& name, bool enabled)
void scroll(float delta)
void scrollToBottom()
[[nodiscard]] bool isAutoScrolling() const noexcept
[[nodiscard]] float scrollOffset() const noexcept
void setMaxScrollOffset(float maxOffset)
void setOnMessageSent(std::function<void(const std::string&, const std::string&)> callback)
void setOnChannelChanged(std::function<void(const std::string&)> callback)
enum ColorPickerInteraction : std::uint8_t 5
None
SaturationValue
HueBar
AlphaBar
Eyedropper
struct UIColorRGBA 4
float r = 1.0f
float g = 1.0f
float b = 1.0f
float a = 1.0f
struct UIColorHSV 3
float h = 0.0f
float s = 1.0f
float v = 1.0f
struct UIColorPreset 4
float r = 0.0f
float g = 0.0f
float b = 0.0f
float a = 1.0f
struct UIColorPickerConfig 17
UINodeId id = INVALID_UI_NODE
std::string name
float width = 260.0f
float height = 300.0f
bool showAlpha = true
bool showHex = true
bool showRGB = true
bool showHSV = false
std::vector<UIColorPreset> presetColors
float hueBarWidth = 20.0f
float alphaBarHeight = 16.0f
float previewSize = 40.0f
std::string backgroundImageKey
std::string hueBarImageKey
float alphaCheckerSize = 8.0f
float fontSize = 12.0f
float labelWidth = 20.0f
class UIColorPicker 19
explicit UIColorPicker(const UIColorPickerConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] UIColorRGBA getColor() const noexcept
[[nodiscard]] UIColorHSV getHSV() const noexcept
[[nodiscard]] float getAlpha() const noexcept
[[nodiscard]] std::string getHex() const
[[nodiscard]] bool isEyedropperActive() const noexcept
void setOnColorChanged(std::function<void(const UIColorRGBA&)> callback)
void setColor(float r, float g, float b, float a = 1.0f)
void setHSV(float h, float s, float v)
void setAlpha(float a)
void selectPreset(std::size_t index)
void onInteractionBegin(ColorPickerInteraction component)
void onSaturationValueUpdate(float normX, float normY)
void onHueBarUpdate(float normY)
void onAlphaBarUpdate(float normX)
void onInteractionEnd()
void toggleEyedropper()
void onEyedropperPick(float r, float g, float b)
struct UIMenuItemDef 6
std::string label
std::string iconImageKey
std::string shortcutText
bool enabled = true
bool separator = false
std::vector<UIMenuItemDef> children
struct UIContextMenuConfig 17
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UIMenuItemDef> items
float width = 200.0f
float itemHeight = 28.0f
int maxVisibleItems = 12
float padding = 4.0f
float separatorHeight = 1.0f
float iconSize = 16.0f
float submenuOffset = -4.0f
float screenWidth = 1920.0f
float screenHeight = 1080.0f
float screenMargin = 4.0f
std::string backgroundImageKey
std::string itemHoverImageKey
std::string separatorImageKey
std::string submenuArrowImageKey
class UIContextMenu 23
explicit UIContextMenu(const UIContextMenuConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] bool isOpen() const noexcept
[[nodiscard]] std::size_t menuDepth() const noexcept
[[nodiscard]] int highlightedIndex(std::size_t depth = 0) const noexcept
[[nodiscard]] std::vector<int> currentPath() const
[[nodiscard]] const std::string& backgroundImageKey() const noexcept
[[nodiscard]] const std::string& itemHoverImageKey() const noexcept
void setItems(const std::vector<UIMenuItemDef>& items)
void setOnItemSelected(std::function<void(int, const std::vector<int>&)> callback)
void setOnClosed(std::function<void()> callback)
void setScreenBounds(float width, float height) noexcept
void open(float x, float y)
void open(float x, float y, const std::vector<UIMenuItemDef>& items)
void close()
void onMouseMove(float mouseX, float mouseY)
void onMouseClick(float mouseX, float mouseY)
void navigateUp()
void navigateDown()
void navigateRight()
void navigateLeft()
void confirmSelection()
void cancel()
enum WindowResizeEdge : std::uint8_t 9
None
Left
Right
Top
Bottom
TopLeft
TopRight
BottomLeft
BottomRight
struct UIDraggableWindowConfig 24
UINodeId id = INVALID_UI_NODE
std::string name
std::string title
float width = 400.0f
float height = 300.0f
float minWidth = 150.0f
float minHeight = 100.0f
float maxWidth = 2000.0f
float maxHeight = 2000.0f
bool resizable = true
bool closeable = true
bool minimizable = true
bool draggable = true
float titleBarHeight = 28.0f
std::string titleBarImageKey
std::string backgroundImageKey
std::string closeButtonImageKey
std::string minimizeButtonImageKey
std::string resizeHandleImageKey
float borderWidth = 1.0f
float padding = 4.0f
float titleFontSize = 14.0f
float initialX = 100.0f
float initialY = 100.0f
class UIDraggableWindow 30
explicit UIDraggableWindow(const UIDraggableWindowConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] bool isOpen() const noexcept
[[nodiscard]] bool isMinimized() const noexcept
[[nodiscard]] bool isDragging() const noexcept
[[nodiscard]] bool isResizing() const noexcept
[[nodiscard]] float posX() const noexcept
[[nodiscard]] float posY() const noexcept
[[nodiscard]] float width() const noexcept
[[nodiscard]] float height() const noexcept
[[nodiscard]] std::uint32_t zOrder() const noexcept
[[nodiscard]] const std::string& title() const noexcept
[[nodiscard]] sgc::Rectf contentBounds() const noexcept
[[nodiscard]] sgc::Rectf titleBarBounds() const noexcept
void addChild(std::shared_ptr<UINode> child)
[[nodiscard]] const std::vector<std::shared_ptr<UINode>>& children() const noexcept
void open()
void close()
void minimize()
void restore()
void setTitle(const std::string& title)
void setZOrder(std::uint32_t z)
void bringToFront()
void setOnClose(std::function<void()> callback)
void setOnMinimize(std::function<void()> callback)
void setOnRestore(std::function<void()> callback)
void setOnBringToFront(std::function<void(std::uint32_t)> callback)
void onPointerDown(float px, float py)
void onPointerMove(float px, float py)
void onPointerUp()
struct UIDropdownConfig 7
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<std::string> options
int selectedIndex = -1
float width = 180.0f
float itemHeight = 24.0f
int maxVisibleItems = 6
class UIDropdown 20
explicit UIDropdown(const UIDropdownConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] bool isOpen() const noexcept
[[nodiscard]] int selectedIndex() const noexcept
[[nodiscard]] std::string selectedText() const
[[nodiscard]] const std::vector<std::string>& options() const noexcept
[[nodiscard]] int scrollOffset() const noexcept
[[nodiscard]] int highlightedIndex() const noexcept
void setOnSelectionChanged(std::function<void(int)> callback)
void setOptions(std::vector<std::string> options)
void setSelectedIndex(int index)
void toggle()
void open()
void close()
void selectItem(int index)
void highlightItem(int index)
void highlightPrevious()
void highlightNext()
void confirmHighlighted()
void scroll(int delta)
enum FloatingTextFontWeight : std::uint8_t 8
Normal
Bold
ExtraBold
[[nodiscard]] inline UIFloatingTextStyle damageStyle() noexcept
[[nodiscard]] inline UIFloatingTextStyle healStyle() noexcept
[[nodiscard]] inline UIFloatingTextStyle criticalStyle() noexcept
[[nodiscard]] inline UIFloatingTextStyle itemPickupStyle() noexcept
[[nodiscard]] inline UIFloatingTextStyle expGainStyle() noexcept
struct UIFloatingTextStyle 6
float fontSize = 24.0f
float outlineWidth = 0.0f
float shadowOffsetX = 0.0f
float shadowOffsetY = 0.0f
FloatingTextFontWeight fontWeight = FloatingTextFontWeight::Normal
std::string backgroundImageKey
struct UIFloatingTextConfig 6
float defaultDuration = 1.0f
float defaultRiseSpeed = 80.0f
float defaultFadeStart = 0.6f
std::size_t maxActive = 32
bool stackSamePosition = true
float stackOffset = 20.0f
struct UIFloatingTextEntry 18
std::string text
float x = 0.0f
float y = 0.0f
UIFloatingTextStyle style
float duration = 1.0f
float riseSpeed = 80.0f
float fadeStart = 0.6f
float scaleStart = 1.0f
float scaleEnd = 1.0f
EasingType easing = EasingType::EaseOutQuad
bool shakeEnabled = false
float shakeAmount = 3.0f
float shakeFrequency = 20.0f
float elapsed = 0.0f
float currentX = 0.0f
float currentY = 0.0f
float currentAlpha = 1.0f
float currentScale = 1.0f
class UIFloatingTextManager 10
UIFloatingTextManager() = default
explicit UIFloatingTextManager(const UIFloatingTextConfig& config)
[[nodiscard]] const UIFloatingTextConfig& config() const noexcept
void setConfig(const UIFloatingTextConfig& config)
UIFloatingTextEntry* spawn(const std::string& text, float x, float y, const UIFloatingTextStyle& style)
UIFloatingTextEntry* spawnCustom(UIFloatingTextEntry entry)
void update(float dt)
[[nodiscard]] const std::vector<UIFloatingTextEntry>& activeEntries() const noexcept
[[nodiscard]] std::size_t activeCount() const noexcept
void clearAll()
enum UIFormFieldType : std::uint8_t 7
Text
Number
Password
Toggle
Slider
Dropdown
RadioGroup
enum LabelAlign : std::uint8_t 3
Left
Right
using FormValidationFn = std::function<std::string(const std::string&)>;
struct UIFormError 2
std::string key
std::string message
struct UIFormField 12
std::string label
UIFormFieldType fieldType = UIFormFieldType::Text
std::string key
bool required = false
std::string placeholder
std::string validationRegex
FormValidationFn validationCallback
std::string errorMessage
std::string defaultValue
std::vector<std::string> options
float sliderMin = 0.0f
float sliderMax = 1.0f
struct UIFormConfig 11
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UIFormField> fields
float labelWidth = 120.0f
float fieldWidth = 200.0f
float rowSpacing = 8.0f
LabelAlign labelAlign = LabelAlign::Left
std::string submitLabel = "Submit"
std::string cancelLabel = "Cancel"
std::string backgroundImageKey
std::string requiredMarker = "*"
class UIForm 23
explicit UIForm(const UIFormConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] float totalWidth() const noexcept
[[nodiscard]] float totalHeight() const noexcept
[[nodiscard]] const std::vector<UIFormField>& fields() const noexcept
[[nodiscard]] std::int32_t focusedFieldIndex() const noexcept
[[nodiscard]] std::string fieldError(const std::string& key) const
[[nodiscard]] const std::map<std::string, std::string>& values() const noexcept
void setValue(const std::string& key, const std::string& value)
[[nodiscard]] std::string getValue(const std::string& key) const
[[nodiscard]] std::vector<UIFormError> validate()
[[nodiscard]] bool isValid()
void reset()
bool submit()
void cancel()
void setOnSubmit(std::function<void(const std::map<std::string, std::string>&)> callback)
void setOnCancel(std::function<void()> callback)
void setOnValueChanged(std::function<void(const std::string&, const std::string&)> callback)
void focusField(std::int32_t index)
void focusNext()
void focusPrevious()
void onEnterPressed()
void onTabPressed(bool shiftHeld)
enum HotbarOrientation : std::uint8_t 2
Horizontal
Vertical
struct UIHotbarConfig 13
UINodeId id = INVALID_UI_NODE
std::string name
std::uint32_t slotCount = 10
float slotSize = 48.0f
float spacing = 4.0f
HotbarOrientation orientation = HotbarOrientation::Horizontal
std::string backgroundImageKey
std::string slotImageKey
std::string slotHoverImageKey
std::string slotActiveImageKey
float keybindFontSize = 10.0f
float labelFontSize = 10.0f
float padding = 4.0f
struct UIHotbarSlot 7
std::string iconImageKey
std::string label
std::string keybind
float cooldownPercent = 0.0f
std::uint32_t quantity = 0
bool enabled = true
bool active = false
class UIHotbar 19
explicit UIHotbar(const UIHotbarConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] std::uint32_t slotCount() const noexcept
[[nodiscard]] const UIHotbarSlot& slot(std::uint32_t index) const noexcept
[[nodiscard]] std::int32_t hoveredSlot() const noexcept
[[nodiscard]] float totalWidth() const noexcept
[[nodiscard]] float totalHeight() const noexcept
[[nodiscard]] sgc::Rectf slotBounds(std::uint32_t index) const noexcept
void setSlot(std::uint32_t index, const UIHotbarSlot& slotData)
void clearSlot(std::uint32_t index)
void triggerSlot(std::uint32_t index)
void update([[maybe_unused]] float dt)
void setOnSlotTriggered(std::function<void(std::uint32_t)> callback)
void setOnSlotRightClicked(std::function<void(std::uint32_t)> callback)
void onPointerMove(float localX, float localY)
void onPointerLeave()
void onPointerDown(float localX, float localY)
void onRightClick(float localX, float localY)
void onKeyDown(const std::string& key)
enum ItemRarity : std::uint8_t 5
Common
Uncommon
Rare
Epic
Legendary
struct GridPos 4
std::uint32_t col = 0
std::uint32_t row = 0
[[nodiscard]] bool operator==(const GridPos& other) const noexcept
[[nodiscard]] bool operator!=(const GridPos& other) const noexcept
struct UIInventoryItem 7
std::uint32_t id = 0
std::string iconImageKey
std::string name
std::string description
std::uint32_t stackCount = 1
std::uint32_t maxStack = 1
ItemRarity rarity = ItemRarity::Common
struct UIInventoryGridConfig 13
UINodeId id = INVALID_UI_NODE
std::string name
std::uint32_t columns = 8
std::uint32_t rows = 4
float cellSize = 48.0f
float cellSpacing = 2.0f
float padding = 4.0f
std::string backgroundImageKey
std::string cellImageKey
std::string cellHoverImageKey
std::string cellSelectedImageKey
float dragGhostAlpha = 0.6f
float stackCountFontSize = 10.0f
class UIInventoryGrid 29
explicit UIInventoryGrid(const UIInventoryGridConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] std::uint32_t columns() const noexcept
[[nodiscard]] std::uint32_t rows() const noexcept
[[nodiscard]] float totalWidth() const noexcept
[[nodiscard]] float totalHeight() const noexcept
[[nodiscard]] sgc::Rectf cellBounds(std::uint32_t col, std::uint32_t row) const noexcept
[[nodiscard]] bool isValidPos(std::uint32_t col, std::uint32_t row) const noexcept
[[nodiscard]] bool isDragging() const noexcept
[[nodiscard]] GridPos dragOrigin() const noexcept
[[nodiscard]] float dragGhostX() const noexcept
[[nodiscard]] float dragGhostY() const noexcept
[[nodiscard]] std::optional<UIInventoryItem> getItem(std::uint32_t col, std::uint32_t row) const
void setItem(std::uint32_t col, std::uint32_t row, const UIInventoryItem& item)
std::optional<UIInventoryItem> removeItem(std::uint32_t col, std::uint32_t row)
void swapItems(GridPos from, GridPos to)
bool moveItem(GridPos from, GridPos to)
bool acceptExternalDrop(const UIInventoryItem& item, std::uint32_t col, std::uint32_t row)
void setOnItemMoved(std::function<void(GridPos, GridPos)> callback)
void setOnItemDropped(std::function<void(const UIInventoryItem&, GridPos)> callback)
void setOnItemRightClicked(std::function<void(const UIInventoryItem&)> callback)
void setOnItemHovered(std::function<void(const UIInventoryItem&, GridPos)> callback)
void onPointerMove(float localX, float localY)
void onPointerLeave()
void onPointerDown(float localX, float localY)
void onPointerUp(float localX, float localY)
void onRightClick(float localX, float localY)
void cancelDrag()
std::optional<UIInventoryItem> extractDraggedItem()
struct UIListItem 3
std::string text
std::string icon
std::any userData
struct UIListViewConfig 7
UINodeId id = INVALID_UI_NODE
std::string name
float itemHeight = 28.0f
int visibleItems = 8
bool selectable = true
bool multiSelect = false
float width = 250.0f
class UIListView 23
explicit UIListView(const UIListViewConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] std::size_t itemCount() const noexcept
[[nodiscard]] const std::vector<UIListItem>& items() const noexcept
[[nodiscard]] const std::set<int>& selectedIndices() const noexcept
[[nodiscard]] int selectedIndex() const noexcept
[[nodiscard]] int focusedIndex() const noexcept
[[nodiscard]] int scrollOffset() const noexcept
[[nodiscard]] std::pair<int, int> visibleRange() const noexcept
void addItem(UIListItem item)
void insertItem(std::size_t index, UIListItem item)
void removeItem(std::size_t index)
void clearItems()
void setItems(std::vector<UIListItem> items)
void setOnItemSelected(std::function<void(int)> callback)
void selectItem(int index, bool addToSelection = false)
void deselectItem(int index)
void clearSelection()
[[nodiscard]] bool isSelected(int index) const
void focusPrevious()
void focusNext()
void confirmFocused()
void scroll(int delta)
struct UIMenuDef 3
std::string label
std::vector<UIMenuItemDef> items
bool enabled = true
struct UIMenuBarConfig 20
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UIMenuDef> menus
float height = 28.0f
float itemPaddingX = 12.0f
float itemPaddingY = 4.0f
float fontSize = 14.0f
float barWidth = 0.0f
float dropdownWidth = 200.0f
float dropdownItemHeight = 28.0f
int dropdownMaxVisibleItems = 12
float dropdownPadding = 4.0f
float screenWidth = 1920.0f
float screenHeight = 1080.0f
std::string backgroundImageKey
std::string activeItemImageKey
std::string hoverItemImageKey
std::string dropdownBackgroundImageKey
std::string dropdownItemHoverImageKey
std::string dropdownSeparatorImageKey
class UIMenuBar 28
explicit UIMenuBar(const UIMenuBarConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const UIContextMenu& dropdown() const noexcept
[[nodiscard]] bool isMenuOpen() const noexcept
[[nodiscard]] int activeMenuIndex() const noexcept
[[nodiscard]] int hoveredMenuIndex() const noexcept
[[nodiscard]] std::size_t menuCount() const noexcept
[[nodiscard]] bool isActivated() const noexcept
[[nodiscard]] float height() const noexcept
[[nodiscard]] const std::string& backgroundImageKey() const noexcept
[[nodiscard]] const std::string& activeItemImageKey() const noexcept
[[nodiscard]] MenuLabelInfo menuLabelInfo(std::size_t index) const noexcept
void addMenu(const std::string& label, const std::vector<UIMenuItemDef>& items)
void setOnMenuItemSelected(std::function<void(int, int)> callback)
void setMenuLabelWidth(std::size_t index, float width)
void setScreenBounds(float width, float height) noexcept
void onMouseMove(float mouseX, float mouseY)
void onMouseClick(float mouseX, float mouseY)
void toggleActivation()
void navigateNextMenu()
void navigatePreviousMenu()
void openHoveredMenu()
void dropdownNavigateUp()
void dropdownNavigateDown()
void dropdownNavigateRight()
void dropdownNavigateLeft()
void dropdownConfirm()
void dropdownCancel()
struct UINumberSpinnerConfig 17
UINodeId id = INVALID_UI_NODE
std::string name
float value = 0.0f
float min = 0.0f
float max = 100.0f
float step = 1.0f
int decimalPlaces = 0
float width = 160.0f
float height = 32.0f
float buttonWidth = 32.0f
float inputWidth = 96.0f
std::string incrementImageKey
std::string decrementImageKey
std::string inputBackgroundImageKey
float fontSize = 14.0f
float holdRepeatDelay = 0.5f
float holdRepeatRate = 0.1f
class UINumberSpinner 21
explicit UINumberSpinner(const UINumberSpinnerConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] float getValue() const noexcept
[[nodiscard]] float getMin() const noexcept
[[nodiscard]] float getMax() const noexcept
[[nodiscard]] bool isEditing() const noexcept
void setOnValueChanged(std::function<void(float)> callback)
void setValue(float val)
void setRange(float minVal, float maxVal)
void setStep(float step)
void increment()
void decrement()
void beginHoldIncrement()
void beginHoldDecrement()
void endHold()
void update(float dt)
void beginEditing()
void editAppendChar(char ch)
void editBackspace()
void confirmEditing()
void cancelEditing()
enum ProgressLabelFormat : std::uint8_t 3
None
ValueSlashMax
Percent
struct UIProgressBarConfig 11
UINodeId id = INVALID_UI_NODE
std::string name
float min = 0.0f
float max = 100.0f
float value = 0.0f
bool showLabel = true
ProgressLabelFormat labelFormat = ProgressLabelFormat::Percent
bool animated = true
bool indeterminate = false
float width = 200.0f
float height = 20.0f
class UIProgressBar 13
explicit UIProgressBar(const UIProgressBarConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] float value() const noexcept
[[nodiscard]] float displayValue() const noexcept
[[nodiscard]] float normalizedValue() const noexcept
[[nodiscard]] bool isIndeterminate() const noexcept
[[nodiscard]] std::string labelText() const
void setValue(float val)
void setRange(float minVal, float maxVal)
void setAnimationSpeed(float unitsPerSecond)
void setIndeterminate(bool indeterminate)
void setLabelFormat(ProgressLabelFormat format)
void update(float deltaTime)
enum RadialMenuAnimation : std::uint8_t 2
Scale
Fade
struct UIRadialMenuItem 5
std::string label
std::string iconImageKey
bool enabled = true
std::string shortcutKey
std::vector<UIRadialMenuItem> subItems
struct UIRadialMenuConfig 14
float innerRadius = 40.0f
float outerRadius = 150.0f
std::vector<UIRadialMenuItem> items
std::string centerIconImageKey
std::string sectorBackgroundImageKey
std::string sectorHoverImageKey
std::string sectorDisabledImageKey
float labelFontSize = 14.0f
float iconSize = 32.0f
float animationDuration = 0.2f
RadialMenuAnimation openAnimation = RadialMenuAnimation::Scale
float centerDeadZone = 30.0f
float subRingInnerRadius = 160.0f
float subRingOuterRadius = 250.0f
struct UIRadialSectorInfo 11
int index = -1
float startAngle = 0.0f
float endAngle = 0.0f
float midAngle = 0.0f
float iconX = 0.0f
float iconY = 0.0f
float labelX = 0.0f
float labelY = 0.0f
bool hovered = false
bool enabled = true
bool hasSubItems = false
class UIRadialMenu 23
UIRadialMenu()
explicit UIRadialMenu(const UIRadialMenuConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const UIRadialMenuConfig& config() const noexcept
void setConfig(const UIRadialMenuConfig& config)
void open(float centerX, float centerY)
void close()
[[nodiscard]] bool isOpen() const noexcept
[[nodiscard]] bool isAnimating() const noexcept
[[nodiscard]] float animationProgress() const noexcept
[[nodiscard]] float centerX() const noexcept
[[nodiscard]] float centerY() const noexcept
void update(float mouseX, float mouseY, float dt)
void confirm()
void selectByKey(const std::string& key)
[[nodiscard]] int hoveredIndex() const noexcept
[[nodiscard]] int hoveredSubIndex() const noexcept
[[nodiscard]] bool isSubRingOpen() const noexcept
[[nodiscard]] const std::vector<UIRadialSectorInfo>& sectors() const noexcept
[[nodiscard]] const std::vector<UIRadialSectorInfo>& subSectors() const noexcept
[[nodiscard]] const std::vector<UIRadialMenuItem>& items() const noexcept
void setOnItemSelected(std::function<void(int)> callback)
void setOnSubItemSelected(std::function<void(int, int)> callback)
enum RadioOrientation : std::uint8_t 2
Vertical
Horizontal
struct UIRadioOption 4
std::string label
std::string value
bool enabled = true
std::string iconImageKey
struct UIRadioGroupConfig 12
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UIRadioOption> options
int selectedIndex = 0
RadioOrientation orientation = RadioOrientation::Vertical
float spacing = 8.0f
float radioSize = 16.0f
float labelGap = 6.0f
std::string radioImageKey
std::string radioCheckedImageKey
std::string radioDisabledImageKey
float fontSize = 14.0f
class UIRadioGroup 13
explicit UIRadioGroup(const UIRadioGroupConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] int selectedIndex() const noexcept
[[nodiscard]] const std::string& selectedValue() const
[[nodiscard]] int focusedIndex() const noexcept
[[nodiscard]] std::size_t optionCount() const noexcept
[[nodiscard]] const std::vector<UIRadioOption>& options() const noexcept
void setOnSelectionChanged(std::function<void(int, const std::string&)> callback)
void setOptions(std::vector<UIRadioOption> options)
void select(int index)
void focusPrevious()
void focusNext()
void confirmFocused()
enum Orientation : std::uint8_t 2
Horizontal
Vertical
struct UISliderConfig 10
UINodeId id = INVALID_UI_NODE
std::string name
float min = 0.0f
float max = 1.0f
float value = 0.0f
float step = 0.0f
Orientation orientation = Orientation::Horizontal
float trackLength = 200.0f
float trackThickness = 8.0f
float handleSize = 16.0f
class UISlider 16
explicit UISlider(const UISliderConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] float value() const noexcept
[[nodiscard]] float min() const noexcept
[[nodiscard]] float max() const noexcept
[[nodiscard]] float normalizedValue() const noexcept
[[nodiscard]] bool isDragging() const noexcept
void setOnValueChanged(std::function<void(float)> callback)
void setValue(float val)
void setRange(float minVal, float maxVal)
void setEnabled(bool enabled)
void onDragBegin()
void onDragUpdate(float normalizedPos)
void onDragEnd()
void increment()
void decrement()
enum SplitterOrientation : std::uint8_t 2
Horizontal
Vertical
struct UISplitterConfig 14
UINodeId id = INVALID_UI_NODE
std::string name
SplitterOrientation orientation = SplitterOrientation::Horizontal
float initialRatio = 0.5f
float minRatio = 0.1f
float maxRatio = 0.9f
float handleSize = 6.0f
float totalWidth = 800.0f
float totalHeight = 600.0f
std::string handleImageKey
std::string handleHoverImageKey
std::string handleDragImageKey
std::string panelABackgroundImageKey
std::string panelBBackgroundImageKey
class UISplitter 17
explicit UISplitter(const UISplitterConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] float getRatio() const noexcept
[[nodiscard]] bool isDragging() const noexcept
[[nodiscard]] bool isHovered() const noexcept
[[nodiscard]] PanelBounds panelABounds() const noexcept
[[nodiscard]] PanelBounds panelBBounds() const noexcept
[[nodiscard]] PanelBounds handleBounds() const noexcept
void setOnRatioChanged(std::function<void(float)> callback)
void setRatio(float ratio)
void setSize(float width, float height)
void onHandleHoverEnter()
void onHandleHoverLeave()
void beginDrag(float pointerPos)
void updateDrag(float pointerPos)
void endDrag()
void resetToCenter()
enum TabBarOrientation : std::uint8_t 4
Top
Bottom
Left
Right
struct UITabBarConfig 8
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<std::string> tabs
int selectedIndex = 0
TabBarOrientation orientation = TabBarOrientation::Top
float tabWidth = 0.0f
float tabHeight = 32.0f
float totalWidth = 400.0f
class UITabBar 11
explicit UITabBar(const UITabBarConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] int selectedIndex() const noexcept
[[nodiscard]] const std::string& selectedTabText() const
[[nodiscard]] const std::vector<std::string>& tabs() const noexcept
[[nodiscard]] std::size_t tabCount() const noexcept
void setOnTabChanged(std::function<void(int)> callback)
void setTabs(std::vector<std::string> tabs)
void selectTab(int index)
void selectNext()
void selectPrevious()
enum TableAlign : std::uint8_t 3
Left
Center
Right
struct UITableColumn 8
std::string header
std::string key
float width = 100.0f
float minWidth = 40.0f
bool sortable = true
bool resizable = true
TableAlign align = TableAlign::Left
std::string headerImageKey
struct UITableRow 4
std::vector<std::string> cells
std::any data
bool selected = false
bool enabled = true
struct UITableConfig 17
UINodeId id = INVALID_UI_NODE
std::string name
std::vector<UITableColumn> columns
float rowHeight = 28.0f
float headerHeight = 32.0f
std::string headerBackgroundImageKey
std::string rowBackgroundImageKey
std::string rowAlternateImageKey
std::string rowHoverImageKey
std::string rowSelectedImageKey
std::string separatorColor
std::string sortIndicatorImageKey
float resizeHandleWidth = 4.0f
float fontSize = 13.0f
float headerFontSize = 14.0f
int maxVisibleRows = 10
bool scrollable = true
class UITable 26
explicit UITable(const UITableConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] std::size_t rowCount() const noexcept
[[nodiscard]] const std::vector<UITableColumn>& columns() const noexcept
[[nodiscard]] const std::vector<UITableRow>& rows() const noexcept
[[nodiscard]] std::vector<int> getSelectedRows() const
[[nodiscard]] int sortColumn() const noexcept
[[nodiscard]] bool isSortAscending() const noexcept
[[nodiscard]] std::pair<int, int> visibleRange() const noexcept
void setOnRowSelected(std::function<void(int)> callback)
void setOnColumnSorted(std::function<void(int, bool)> callback)
void setOnCellClicked(std::function<void(int, int)> callback)
void setData(std::vector<UITableRow> rows)
void addRow(UITableRow row)
void removeRow(int index)
void clearData()
void sortBy(int column, bool ascending)
void selectRow(int index)
void clearSelection()
void clickCell(int row, int col)
void clickHeader(int column)
void setHoveredRow(int index)
void beginColumnResize(int column, float startX)
void updateColumnResize(float currentX)
void endColumnResize()
void scroll(int delta)
struct UITextInputConfig 9
UINodeId id = INVALID_UI_NODE
std::string name
std::string placeholder
std::string initialText
std::size_t maxLength = 256
bool password = false
bool multiline = false
float width = 200.0f
float height = 28.0f
class UITextInput 23
explicit UITextInput(const UITextInputConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const std::string& text() const noexcept
[[nodiscard]] std::string displayText() const
[[nodiscard]] std::size_t cursorPos() const noexcept
[[nodiscard]] std::size_t selectionStart() const noexcept
[[nodiscard]] std::size_t selectionEnd() const noexcept
[[nodiscard]] bool hasSelection() const noexcept
[[nodiscard]] bool isFocused() const noexcept
void setOnTextChanged(std::function<void(const std::string&)> callback)
void setOnSubmit(std::function<void(const std::string&)> callback)
void setText(const std::string& text)
void onFocus()
void onBlur()
void insertText(const std::string& str)
void deleteBackward()
void deleteForward()
void moveCursor(int offset, bool extendSelection = false)
void moveToStart(bool extendSelection = false)
void moveToEnd(bool extendSelection = false)
void selectAll()
void onSubmitKey()
[[nodiscard]] std::string selectedText() const
enum ToastPosition : std::uint8_t 6
TopLeft
TopRight
BottomLeft
BottomRight
TopCenter
BottomCenter
enum ToastStackDirection : std::uint8_t 2
Up
Down
enum ToastType : std::uint8_t 4
Info
Success
Warning
Error
enum ToastSlideDirection : std::uint8_t 4
Left
Right
Up
Down
struct UIToastTypeStyle 2
std::string backgroundImageKey
std::string iconImageKey
struct UIToastConfig 27
UINodeId id = INVALID_UI_NODE
std::string name
ToastPosition position = ToastPosition::TopRight
ToastStackDirection stackDirection = ToastStackDirection::Down
int maxVisible = 5
float spacing = 8.0f
float width = 320.0f
float minHeight = 48.0f
float padding = 12.0f
float iconSize = 24.0f
float marginX = 16.0f
float marginY = 16.0f
float defaultDuration = 4.0f
float slideInDuration = 0.25f
float slideOutDuration = 0.2f
ToastSlideDirection slideInDirection = ToastSlideDirection::Right
ToastSlideDirection slideOutDirection = ToastSlideDirection::Right
float slideDistance = 0.0f
float screenWidth = 1920.0f
float screenHeight = 1080.0f
std::string backgroundImageKey
std::string closeButtonImageKey
std::string iconImageKey
UIToastTypeStyle infoStyle
UIToastTypeStyle successStyle
UIToastTypeStyle warningStyle
UIToastTypeStyle errorStyle
struct UIToastEntry 6
std::uint32_t id = 0
std::string text
std::string iconImageKey
float duration = 4.0f
ToastType type = ToastType::Info
float timestamp = 0.0f
class UIToastManager 18
explicit UIToastManager(const UIToastConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] std::size_t activeCount() const noexcept
[[nodiscard]] std::size_t visibleCount() const noexcept
[[nodiscard]] bool hasToasts() const noexcept
[[nodiscard]] const std::string& backgroundImageKey() const noexcept
[[nodiscard]] const std::string& closeButtonImageKey() const noexcept
[[nodiscard]] std::vector<ToastRenderInfo> renderInfo() const
void setOnDismissed(std::function<void(std::uint32_t)> callback)
void setOnClicked(std::function<void(std::uint32_t)> callback)
void setToastHeight(std::uint32_t toastId, float height)
void setScreenBounds(float width, float height) noexcept
std::uint32_t show(const std::string& text, ToastType type = ToastType::Info, float duration = 0.0f)
std::uint32_t show(const std::string& text, const std::string& iconImageKey, ToastType type = ToastType::Info, float duration = 0.0f)
void dismiss(std::uint32_t toastId)
void dismissAll()
void onMouseClick(float mouseX, float mouseY)
void update(float dt)
enum ToggleStyle : std::uint8_t 2
Checkbox
Switch
struct UIToggleConfig 8
UINodeId id = INVALID_UI_NODE
std::string name
std::string label
bool checked = false
bool enabled = true
ToggleStyle style = ToggleStyle::Checkbox
float width = 0.0f
float height = 24.0f
class UIToggle 10
explicit UIToggle(const UIToggleConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] bool isChecked() const noexcept
[[nodiscard]] bool isEnabled() const noexcept
[[nodiscard]] const std::string& label() const noexcept
void setOnChanged(std::function<void(bool)> callback)
void setChecked(bool checked)
void setLabel(const std::string& label)
void setEnabled(bool enabled)
void onClick()
enum TooltipPosition : std::uint8_t 5
Above
Below
Left
Right
Auto
struct UITooltipConfig 20
UINodeId id = INVALID_UI_NODE
std::string name
std::string text
float maxWidth = 300.0f
float padding = 8.0f
float arrowSize = 6.0f
float anchorOffsetX = 0.0f
float anchorOffsetY = 0.0f
TooltipPosition position = TooltipPosition::Auto
float showDelay = 0.5f
float hideDelay = 0.1f
float fadeInDuration = 0.15f
float fadeOutDuration = 0.1f
bool followMouse = false
float screenMargin = 4.0f
float screenWidth = 1920.0f
float screenHeight = 1080.0f
std::string backgroundImageKey
std::string borderImageKey
std::string arrowImageKey
class UITooltip 21
explicit UITooltip(const UITooltipConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] bool isVisible() const noexcept
[[nodiscard]] float opacity() const noexcept
[[nodiscard]] sgc::Rectf currentBounds() const noexcept
[[nodiscard]] TooltipPosition resolvedPosition() const noexcept
[[nodiscard]] const std::string& text() const noexcept
[[nodiscard]] const std::string& backgroundImageKey() const noexcept
[[nodiscard]] const std::string& borderImageKey() const noexcept
[[nodiscard]] const std::string& arrowImageKey() const noexcept
void show(const std::string& text, float x, float y)
void show(float x, float y)
void hide()
void hideImmediate()
void attachTo(std::shared_ptr<UINode> target)
void detach()
void updateCursorPosition(float x, float y) noexcept
void setContentSize(float width, float height) noexcept
void setScreenBounds(float width, float height) noexcept
void update(float dt)
using TreeNodePath = std::vector<int>;
struct UITreeNode 8
std::string label
std::string iconImageKey
std::string expandedIconImageKey
std::vector<UITreeNode> children
bool expanded = false
bool selected = false
bool enabled = true
std::any data
struct UITreeViewConfig 13
UINodeId id = INVALID_UI_NODE
std::string name
float indentWidth = 20.0f
float nodeHeight = 24.0f
std::string expandIconImageKey
std::string collapseIconImageKey
std::string nodeBackgroundImageKey
std::string nodeHoverImageKey
std::string nodeSelectedImageKey
std::string connectionLineColor
float connectionLineWidth = 1.0f
float fontSize = 13.0f
bool multiSelect = false
class UITreeView 22
explicit UITreeView(const UITreeViewConfig& config)
[[nodiscard]] std::shared_ptr<UINode> node() const noexcept
[[nodiscard]] const std::vector<UITreeNode>& roots() const noexcept
[[nodiscard]] const std::vector<FlatEntry>& flatList() const noexcept
[[nodiscard]] const std::vector<TreeNodePath>& getSelectedNodes() const noexcept
[[nodiscard]] const TreeNodePath& focusedPath() const noexcept
void setOnNodeSelected(std::function<void(const TreeNodePath&)> callback)
void setOnNodeExpanded(std::function<void(const TreeNodePath&)> callback)
void setOnNodeCollapsed(std::function<void(const TreeNodePath&)> callback)
void setRoot(std::vector<UITreeNode> roots)
void expand(const TreeNodePath& path)
void collapse(const TreeNodePath& path)
void expandAll()
void collapseAll()
void toggle(const TreeNodePath& path)
void selectNode(const TreeNodePath& path)
void clearSelection()
void focusPrevious()
void focusNext()
void focusLeft()
void focusRight()
void confirmFocused()

Sourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.