engine/ext/gui/behavior.h

55 lines
1.3 KiB
C++

#pragma once
#include <uf/config.h>
#include <uf/ext/ext.h>
#include <uf/engine/entity/entity.h>
#include <uf/engine/scene/scene.h>
#include <uf/utils/math/vector.h>
namespace ext {
namespace GuiBehavior {
UF_BEHAVIOR_DEFINE_TYPE();
EXT_BEHAVIOR_DEFINE_TRAITS();
EXT_BEHAVIOR_DEFINE_FUNCTIONS();
UF_BEHAVIOR_DEFINE_METADATA(
pod::Vector4f color = {1,1,1,1};
bool world = false;
pod::Vector2f size = {0,0};
size_t mode = 0;
struct {
pod::Vector2f min = { 1, 1 };
pod::Vector2f max = { -1, -1 };
} box;
bool clickable = false;
bool clicked = false;
bool hoverable = false;
bool hovered = false;
pod::Vector4f uv = {0, 0, 1, 1};
size_t shader = 0;
float depth = 0;
float alpha = -1;
);
struct GlyphMetadata : public pod::Behavior::Metadata {
void serialize( uf::Object&, uf::Serializer& );
void deserialize( uf::Object&, uf::Serializer& );
uf::stl::string font = "";
uf::stl::string string = "";
float scale = 0;
pod::Vector2f padding = {0,0};
float spread = 0;
float size = 0;
float weight = 0;
bool sdf = false;
bool shadowbox = false;
pod::Vector4f stroke = {0,0,0,0};
uf::stl::string origin = "";
uf::stl::string align = "";
uf::stl::string direction = "";
};
}
}