|
|
- #pragma once
- #include "component.h"
- #include <string>
- #include "raylib.h"
- #include "transform.h"
-
- namespace ant::components::ui {
- struct panel_component : public ant::core::component {
- panel_component() {}
- panel_component(
- int layer = 0,
- Color color = BLUE,
- ant::core::Vec2<> size = {100,100},
- ant::core::Vec2<> scale = {1,1}
- );
- std::string name() override {return "panel_component";}
- void initialize() override;
- void render() override;
- void update(std::chrono::duration<double>) override;
- ant::core::Vec2<> scale();
- private:
- ant::core::Vec2<> m_size;
- ant::core::Vec2<> m_scale;
- int m_layer; //< This is ignored if a parent panel is found, panels bleed up to one layer below their current layer
- Color m_color;
- std::weak_ptr<panel_component> m_parent_panel = std::shared_ptr<panel_component>(nullptr);
- };
- }
|