UI Border Done

This commit is contained in:
2023-04-29 20:55:32 -07:00
parent 0040a54001
commit 47d95ac8ce
10 changed files with 175 additions and 85 deletions

View File

@ -7,7 +7,7 @@
#include "dawnlibs.hpp"
#include "display/Transform.hpp"
#include "scene/SceneItem.hpp"
#include "state/State.hpp"
#include "state/StateOwner.hpp"
namespace Dawn {
class DawnGame;

View File

@ -84,7 +84,7 @@ void UIBorder::onStart() {
4 * QUAD_VERTICE_COUNT, 4 * QUAD_INDICE_COUNT
);
QuadMesh::bufferQuadMesh(&mesh,
glm::vec2(iSize.x + bSize.x, 0), tSize + glm::vec2(tSize.x, 0),
glm::vec2(iSize.x + bSize.x, bSize.y), tSize + glm::vec2(tSize.x, 0),
glm::vec2(this->getWidth(), bSize.y + iSize.y), glm::vec2(1.0f, tSize.y + tSize.y),
5 * QUAD_VERTICE_COUNT, 5 * QUAD_INDICE_COUNT
);

View File

@ -35,9 +35,7 @@ namespace Dawn {
class UIComponent : public SceneItemComponent, public UIComponentDimensional {
protected:
// @optional
float_t width = 1;
// @optional
float_t height = 1;
StateEvent<> eventAlignmentUpdated;
@ -77,8 +75,11 @@ namespace Dawn {
glm::vec2 alignment
);
StateProperty<UIComponentAlign> alignX;
StateProperty<UIComponentAlign> alignY;
// @optional
StateProperty<enum UIComponentAlign> alignX;
// @optional
StateProperty<enum UIComponentAlign> alignY;
// @optional
StateProperty<glm::vec4> alignment;
UIComponent(SceneItem *item);

View File

@ -4,7 +4,7 @@
// https://opensource.org/licenses/MIT
#pragma once
#include "state/State.hpp"
#include "state/StateOwner.hpp"
namespace Dawn {
template<typename D, typename...A>