Improve edit screen
This commit is contained in:
parent
52770d7eb2
commit
826986cdbf
12 changed files with 235 additions and 40 deletions
|
@ -29,6 +29,8 @@ export default class GuiElement extends Rect {
|
|||
append(element) {
|
||||
this.children.add(element);
|
||||
element.parent = this;
|
||||
element.x += this.x;
|
||||
element.y += this.y;
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
@ -39,10 +41,10 @@ export default class GuiElement extends Rect {
|
|||
|
||||
posRelative({x = null, xc = 0, y = null, yc = 0, w = null, h = null}) {
|
||||
if (x !== null) {
|
||||
this.x = (this.parent.w * x) - (this.w * xc);
|
||||
this.x = (this.parent.w * x) - (this.w * xc) + this.parent.x;
|
||||
}
|
||||
if (y !== null)
|
||||
this.y = (this.parent.h * y) - (this.h * yc);
|
||||
this.y = (this.parent.h * y) - (this.h * yc) + this.parent.y;
|
||||
if (w !== null)
|
||||
this.w = this.parent.w * w;
|
||||
if (h !== null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue