X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FWidget.hpp;h=0f9c8d9d3ad3a77ebadf3fffecd4d78bc312da39;hb=2025d49798b93180237b6ce62d3ff5d6ee8ebc6e;hp=cb83da251dbd9311ef2e04cd79d8b7a842d534a0;hpb=56f570e713c42d30109a214e68a2beed96ba1999;p=blobs.git diff --git a/src/ui/Widget.hpp b/src/ui/Widget.hpp index cb83da2..0f9c8d9 100644 --- a/src/ui/Widget.hpp +++ b/src/ui/Widget.hpp @@ -1,7 +1,6 @@ #ifndef BLOBS_UI_WIDGET_HPP_ #define BLOBS_UI_WIDGET_HPP_ -#include "align.hpp" #include "../graphics/glm.hpp" @@ -27,20 +26,18 @@ public: Widget &operator =(Widget &&) = delete; public: - Widget &Position(const glm::vec3 &p) noexcept { pos = p; return *this; } - const glm::vec3 &Position() const noexcept { return pos; } - glm::vec3 AlignedPosition() noexcept; - glm::vec3 TopLeft() noexcept; + Widget *Position(const glm::vec2 &p) noexcept { pos = p; return this; } + const glm::vec2 &Position() const noexcept { return pos; } - Widget &Origin(Gravity o) noexcept { origin = o; return *this; } - Gravity Origin() const noexcept { return origin; } + Widget *ZIndex(float z) noexcept { z_index = z; return this; } + float ZIndex() const noexcept { return z_index; } virtual glm::vec2 Size() = 0; virtual void Draw(app::Assets &, graphics::Viewport &) noexcept = 0; private: - glm::vec3 pos; - Gravity origin; + glm::vec2 pos; + float z_index; };