Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
ui_object.h
Go to the documentation of this file.
1#pragma once
2
5
16class UIObject : public GameObject {
17 public:
19
29 virtual void update(float dt){};
30
37 virtual void render() const {};
38
39 [[nodiscard]] float width() const;
41
42 [[nodiscard]] float height() const;
44
45 [[nodiscard]] Point pivot() const;
47
48 [[nodiscard]] Point anchor() const;
50
51 protected:
52 float width_;
53 float height_;
56};
Concept to constrain types to be derived from Component.
Definition gameObject.h:33
std::optional< std::reference_wrapper< T > > get_component() const noexcept
Get the first component of type T attached to this GameObject.
Definition gameObject.h:141
Scene & scene() const noexcept
Represents a point in 2D space.
Definition point.h:6
Represents a scene within the engine. A scene contains multiple GameObjects and manages their lifecyc...
Definition scene.h:19
Base class for all UI objects.
Definition ui_object.h:16
Point pivot_
Definition ui_object.h:54
Point pivot() const
float height_
Definition ui_object.h:53
UIObject & height(float height)
virtual void update(float dt)
Update the UI object.
Definition ui_object.h:29
UIObject(Scene &scene, float width, float height, Point pivot, Point anchor)
UIObject & pivot(Point pivot)
virtual void render() const
Render the UI object.
Definition ui_object.h:37
float width_
Definition ui_object.h:52
UIObject & width(float width)
float height() const
Point anchor_
Definition ui_object.h:55
UIObject & anchor(Point anchor)
Point anchor() const
float width() const