Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
label.h
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2025-2026 Manuel Osorio
3#pragma once
4
5#include "flint/core/api.h"
6#include "flint/graphics/types/color.h"
7#include "flint/ui/ui-canvas.h"
8#include "flint/ui/ui-node.h"
9
10#include <string>
11
12namespace Flint {
13
21 class UILabel : public UINode {
22 public:
24 UILabel() = default;
25 FLINT_API explicit UILabel(std::string text);
26 ~UILabel() override = default;
31 FLINT_API void measure(UIConstraints constraints) override;
32 FLINT_API void arrange(const Rect<float> &rect) override;
33 FLINT_API void render(UICanvas &canvas) const override;
34 };
35
36}
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings....
Definition ui-canvas.h:107
A non-interactive text rendering widget.
Definition label.h:21
UILabel()=default
Instantiates a text label with an initial string payload.
FLINT_API void arrange(const Rect< float > &rect) override
Pass 2 of the layout engine: Evaluates layout adjustments to pin final screen coordinate values to th...
FLINT_API void render(UICanvas &canvas) const override
Pushes current styling rules and geometries straight down to the active pipeline vertex drawing queue...
FLINT_API void measure(UIConstraints constraints) override
Computes text bounds using the system text engine.
Abstract base class for all UI widgets, managing hierarchy tracking, layout passes,...
Definition ui-node.h:31
Generic axis-aligned rectangle defined by a position and size.
Definition types.h:87
Represents the boundary budget passed down the node tree during layout allocation.
Definition ui-types.h:76