UINode size-func

This commit is contained in:
MihailRis
2024-05-13 02:57:36 +03:00
parent 017c8722ae
commit f8a5f329a4
3 changed files with 38 additions and 15 deletions
+11
View File
@@ -233,6 +233,14 @@ void UINode::setPositionFunc(vec2supplier func) {
positionfunc = func;
}
vec2supplier UINode::getSizeFunc() const {
return sizefunc;
}
void UINode::setSizeFunc(vec2supplier func) {
sizefunc = func;
}
void UINode::setId(const std::string& id) {
this->id = id;
}
@@ -245,6 +253,9 @@ void UINode::reposition() {
if (positionfunc) {
setPos(positionfunc());
}
if (sizefunc) {
setSize(sizefunc());
}
}
void UINode::setGravity(Gravity gravity) {