mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
misc hud-related updates
This commit is contained in:
parent
1f3d1e2640
commit
11bb9e5926
23 changed files with 400 additions and 165 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include "../../delegates.h"
|
||||
|
||||
class GfxContext;
|
||||
class Assets;
|
||||
|
|
@ -26,6 +27,7 @@ namespace gui {
|
|||
protected:
|
||||
glm::vec2 coord;
|
||||
glm::vec2 size;
|
||||
glm::vec2 minSize {1.0f};
|
||||
glm::vec4 color {1.0f};
|
||||
glm::vec4 hoverColor {1.0f};
|
||||
glm::vec4 margin {1.0f};
|
||||
|
|
@ -38,6 +40,7 @@ namespace gui {
|
|||
int zindex = 0;
|
||||
Align align = Align::left;
|
||||
UINode* parent = nullptr;
|
||||
vec2supplier positionfunc = nullptr;
|
||||
UINode(glm::vec2 coord, glm::vec2 size);
|
||||
public:
|
||||
virtual ~UINode();
|
||||
|
|
@ -112,14 +115,22 @@ namespace gui {
|
|||
/* Calculate screen position of the element */
|
||||
virtual glm::vec2 calcCoord() const;
|
||||
virtual void setCoord(glm::vec2 coord);
|
||||
glm::vec2 getCoord() const;
|
||||
virtual glm::vec2 getCoord() const;
|
||||
virtual glm::vec2 getSize() const;
|
||||
virtual void setSize(glm::vec2 size);
|
||||
virtual glm::vec2 getMinSize() const;
|
||||
virtual void setMinSize(glm::vec2 size);
|
||||
virtual void refresh() {};
|
||||
virtual void lock();
|
||||
|
||||
virtual vec2supplier getPositionFunc() const;
|
||||
virtual void setPositionFunc(vec2supplier);
|
||||
|
||||
void setId(const std::string& id);
|
||||
const std::string& getId() const;
|
||||
|
||||
/* Fetch coord from positionfunc if assigned */
|
||||
void reposition();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue