feat(layers): add layering system

This commit is contained in:
illyum 2024-09-12 21:11:27 -06:00
parent d486da8994
commit 3b87746e7d
3 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#pragma once
struct LayerComponent {
int layer;
LayerComponent(int layer = 0) : layer(layer) {}
};

View File

@ -0,0 +1,5 @@
//
// Created by illyum on 9/12/2024.
//
#include "ui_component.h"

View File

@ -0,0 +1,20 @@
#pragma once
#include <functional>
#include <string>
enum class UIState {
NORMAL,
HOVERED,
CLICKED
};
struct UIComponent {
std::string text;
float width;
float height;
std::function<void()> onClick;
UIState state = UIState::NORMAL;
UIComponent(std::string text, float width, float height, std::function<void()> onClick)
: text(std::move(text)), width(width), height(height), onClick(std::move(onClick)) {}
};