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"
25
26#include <glm/glm.hpp>
27
28namespace esengine::ecs {
29
33ES_COMPONENT(stability=experimental)
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 and metadata system for automatic binding generation.
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Core type definitions and utilities for ESEngine.
The rectangle of this entity's content, in its own units.
glm::vec2 size
Width and height in local units, before the transform's scale.
glm::vec2 pivot
The point of the rectangle the transform sits on, as a fraction of its size.