Estella
0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
ContentRect.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
21
#pragma once
22
23
#include "
../../core/Types.hpp
"
24
#include "
../../core/Reflection.hpp
"
25
26
#include <glm/glm.hpp>
27
28
namespace
esengine::ecs
{
29
33
ES_COMPONENT
(stability=experimental)
34
struct
ContentRect
{
36
ES_PROPERTY
(min=0, tooltip=
"Width and height of the content in local units (before scale)."
)
37
glm::vec2
size
{100.0f, 100.0f};
38
40
ES_PROPERTY
(normalized_of=size, tooltip=
"The point of the rectangle the entity sits on, as a fraction of its size (0.5,0.5 = centre). Rotation and scale turn about it."
)
41
glm::vec2
pivot
{0.5f, 0.5f};
42
};
43
44
}
// namespace esengine::ecs
Reflection.hpp
Reflection and metadata system for automatic binding generation.
ES_COMPONENT
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
Definition
Reflection.hpp:46
ES_PROPERTY
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Definition
Reflection.hpp:95
Types.hpp
Core type definitions and utilities for ESEngine.
esengine::ecs
Definition
AotComponents.generated.hpp:8
esengine::ecs::ContentRect
The rectangle of this entity's content, in its own units.
Definition
ContentRect.hpp:34
esengine::ecs::ContentRect::size
glm::vec2 size
Width and height in local units, before the transform's scale.
Definition
ContentRect.hpp:37
esengine::ecs::ContentRect::pivot
glm::vec2 pivot
The point of the rectangle the transform sits on, as a fraction of its size.
Definition
ContentRect.hpp:41
src
esengine
ecs
components
ContentRect.hpp
Generated by
1.15.0