5#include "flint/core/api.h"
6#include "flint/ui/ui-node.h"
7#include "flint/ui/widgets/sprite.h"
17 enum class IconPlacement {
29 FLINT_API
explicit UIButton(std::string text);
33 FLINT_API
void setOnClick(std::function<
void()> callback);
56 void setIcon(std::unique_ptr<UISprite> icon, IconPlacement placement = IconPlacement::Left) {
57 m_icon = std::move(icon);
59 m_iconPlacement = placement;
69 std::function<void()> m_onClick;
73 void activate()
const;
75 std::unique_ptr<UISprite> m_icon;
76 IconPlacement m_iconPlacement = IconPlacement::Left;
77 float m_iconGap = 4.f;
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings....
Abstract base class for all UI widgets, managing hierarchy tracking, layout passes,...
Generic axis-aligned rectangle defined by a position and size.
Represents the boundary budget passed down the node tree during layout allocation.
A normalized data packet containing translated input data routed down the UI node tree.