CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
UIComponent.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
13#include <functional>
14
16
17 struct UIComponent final : public CeresEngine::Component<UIComponent> {
18 struct Accessor;
19
21 using UIDrawer = std::function<void()>;
22
25
28
33 };
34
35 struct UIComponent::Accessor : public Component<UIComponent>::Accessor {
37
39 };
40
42
43} // namespace CeresEngine::Graphics::UI
44
#define CE_EXTERN_COMPONENT(T)
Definition Component.hpp:600
A type-safe entity type.
Definition Entity.hpp:538
Definition Checkbox.hpp:14
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Accessor(const Entity &entity)
Definition Component.hpp:181
Components serve as the base for data storage for an entity.
Definition Component.hpp:68
Definition UIComponent.hpp:17
UIComponent(UIDrawer drawer)
Create a new UIComponent component.
std::function< void()> UIDrawer
A functor type that gets called every frame to render the UI.
Definition UIComponent.hpp:21
UIComponent()
Create a new UIComponent component.
UIDrawer drawer
A functor that gets called every frame to render the UI.
Definition UIComponent.hpp:24