mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01: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
|
|
@ -119,7 +119,18 @@ glm::vec2 UINode::getSize() const {
|
|||
}
|
||||
|
||||
void UINode::setSize(glm::vec2 size) {
|
||||
this->size = size;
|
||||
this->size = glm::vec2(
|
||||
glm::max(minSize.x, size.x), glm::max(minSize.y, size.y)
|
||||
);
|
||||
}
|
||||
|
||||
glm::vec2 UINode::getMinSize() const {
|
||||
return minSize;
|
||||
}
|
||||
|
||||
void UINode::setMinSize(glm::vec2 minSize) {
|
||||
this->minSize = minSize;
|
||||
setSize(getSize());
|
||||
}
|
||||
|
||||
void UINode::setColor(glm::vec4 color) {
|
||||
|
|
@ -158,6 +169,14 @@ int UINode::getZIndex() const {
|
|||
void UINode::lock() {
|
||||
}
|
||||
|
||||
vec2supplier UINode::getPositionFunc() const {
|
||||
return positionfunc;
|
||||
}
|
||||
|
||||
void UINode::setPositionFunc(vec2supplier func) {
|
||||
positionfunc = func;
|
||||
}
|
||||
|
||||
void UINode::setId(const std::string& id) {
|
||||
this->id = id;
|
||||
}
|
||||
|
|
@ -165,3 +184,9 @@ void UINode::setId(const std::string& id) {
|
|||
const std::string& UINode::getId() const {
|
||||
return id;
|
||||
}
|
||||
|
||||
void UINode::reposition() {
|
||||
if (positionfunc) {
|
||||
setCoord(positionfunc());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue