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
10
namespace
esengine::ecs
{
11
20
struct
LayoutRect
{
21
f32
left
;
22
f32
bottom
;
23
f32
right
;
24
f32
top
;
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
Registry.hpp
Central ECS registry for entity and component management.
UITree.hpp
esengine::ecs
Definition
AotComponents.generated.hpp:8
esengine::f32
float f32
32-bit floating point
Definition
Types.hpp:59
esengine::ecs::LayoutRect
Definition
UILayoutSystem.hpp:20
esengine::ecs::LayoutRect::centerY
f32 centerY() const
Definition
UILayoutSystem.hpp:29
esengine::ecs::LayoutRect::height
f32 height() const
Definition
UILayoutSystem.hpp:27
esengine::ecs::LayoutRect::left
f32 left
Definition
UILayoutSystem.hpp:21
esengine::ecs::LayoutRect::top
f32 top
Definition
UILayoutSystem.hpp:24
esengine::ecs::LayoutRect::width
f32 width() const
Definition
UILayoutSystem.hpp:26
esengine::ecs::LayoutRect::bottom
f32 bottom
Definition
UILayoutSystem.hpp:22
esengine::ecs::LayoutRect::centerX
f32 centerX() const
Definition
UILayoutSystem.hpp:28
esengine::ecs::LayoutRect::right
f32 right
Definition
UILayoutSystem.hpp:23
src
esengine
ui
UILayoutSystem.hpp
Generated by
1.15.0