Estella
0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
UIScroll.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 "
../../core/Types.hpp
"
6
#include "
../../core/Reflection.hpp
"
7
8
namespace
esengine::ecs
{
9
10
ES_ENUM
()
11
enum class
ScrollMovement
:
u8
{
13
Clamped
,
15
Elastic
16
};
17
31
ES_COMPONENT
()
32
struct
UIScroll
{
33
ES_PROPERTY
()
34
bool
enabled
{
true
};
35
37
ES_PROPERTY
(entity_ref, tooltip=
"The child that scrolls inside this node. Leave empty to use the first child."
)
38
u32
content
{0};
39
40
ES_PROPERTY
()
41
bool
horizontal
{
false
};
42
ES_PROPERTY
()
43
bool
vertical
{
true
};
44
45
ES_PROPERTY
(tooltip=
"Clamped stops at the ends; Elastic overshoots and springs back."
)
46
ScrollMovement
movement
{
ScrollMovement::Clamped
};
47
49
ES_PROPERTY
(min=0)
50
f32
wheelSpeed
{1.0f};
51
ES_PROPERTY
()
52
bool
dragScroll
{
true
};
53
58
ES_PROPERTY
(min=0, max=1, tooltip=
"Fraction of flick velocity kept per second. 0 stops on release."
)
59
f32
decelerationRate
{0.135f};
60
};
61
62
}
// 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_ENUM
#define ES_ENUM(...)
Mark an enum that should be exposed to scripts.
Definition
Reflection.hpp:119
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::ScrollMovement
ScrollMovement
Definition
UIScroll.hpp:11
esengine::ecs::ScrollMovement::Clamped
@ Clamped
Definition
UIScroll.hpp:13
esengine::ecs::ScrollMovement::Elastic
@ Elastic
Definition
UIScroll.hpp:15
esengine::u32
std::uint32_t u32
Unsigned 32-bit integer.
Definition
Types.hpp:45
esengine::u8
std::uint8_t u8
Unsigned 8-bit integer.
Definition
Types.hpp:41
esengine::f32
float f32
32-bit floating point
Definition
Types.hpp:59
esengine::ecs::UIScroll
Definition
UIScroll.hpp:32
esengine::ecs::UIScroll::decelerationRate
f32 decelerationRate
Definition
UIScroll.hpp:59
esengine::ecs::UIScroll::vertical
bool vertical
Definition
UIScroll.hpp:43
esengine::ecs::UIScroll::content
u32 content
Definition
UIScroll.hpp:38
esengine::ecs::UIScroll::movement
ScrollMovement movement
Definition
UIScroll.hpp:46
esengine::ecs::UIScroll::dragScroll
bool dragScroll
Definition
UIScroll.hpp:52
esengine::ecs::UIScroll::wheelSpeed
f32 wheelSpeed
Definition
UIScroll.hpp:50
esengine::ecs::UIScroll::horizontal
bool horizontal
Definition
UIScroll.hpp:41
esengine::ecs::UIScroll::enabled
bool enabled
Definition
UIScroll.hpp:34
src
esengine
ecs
components
UIScroll.hpp
Generated by
1.15.0