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/graphics/types/color.h"
6#include "flint/ui/ui-canvas.h"
7#include "flint/ui/ui-node.h"
8
9#include <string>
10
11namespace Flint {
12
20 class UILabel : public UINode {
21 public:
23 UILabel() = default;
24 explicit UILabel(std::string text);
25 ~UILabel() override = default;
30 void measure(UIConstraints constraints) override;
31 void arrange(const Rect<float> &rect) override;
32 void render(UICanvas &canvas) const override;
33 };
34
35}
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings....
Definition ui-canvas.h:106
void measure(UIConstraints constraints) override
Computes text bounds using the system text engine.
void render(UICanvas &canvas) const override
Pushes current styling rules and geometries straight down to the active pipeline vertex drawing queue...
void arrange(const Rect< float > &rect) override
Pass 2 of the layout engine: Evaluates layout adjustments to pin final screen coordinate values to th...
A non-interactive text rendering widget.
Definition label.h:20
UILabel()=default
Instantiates a text label with an initial string payload.
Abstract base class for all UI widgets, managing hierarchy tracking, layout passes,...
Definition ui-node.h:30
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