mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
UINode size-func
This commit is contained in:
parent
017c8722ae
commit
f8a5f329a4
3 changed files with 38 additions and 15 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue