Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
UILayoutSystem.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3#pragma once
4
5#include "../ecs/Registry.hpp"
6#include "./UITree.hpp"
7
8#include <glm/glm.hpp>
9
10namespace esengine::ecs {
11
20struct LayoutRect {
25
26 [[nodiscard]] f32 width() const { return right - left; }
27 [[nodiscard]] f32 height() const { return top - bottom; }
28 [[nodiscard]] f32 centerX() const { return 0.5f * (left + right); }
29 [[nodiscard]] f32 centerY() const { return 0.5f * (bottom + top); }
30};
31
32// Layout and tree operations are methods on UISystem (see UISystem.hpp).
33// Previously free functions (uiLayoutUpdate, getUITree, uiTreeMarkStructureDirty,
34// uiTreeMarkDirty) lived here but held state in a file-level static; that
35// state now lives on UISystem registered via EstellaContext.
36
37} // namespace esengine::ecs
Central ECS registry for entity and component management.
float f32
32-bit floating point
Definition Types.hpp:59