gui and text drawing, gui misc
This commit is contained in:
parent
c906760bd4
commit
4ec8affe85
37 changed files with 799 additions and 646 deletions
|
@ -1,5 +1,8 @@
|
|||
package game.gui.element;
|
||||
|
||||
import game.renderer.Drawing;
|
||||
import game.renderer.Drawing.Vec2i;
|
||||
|
||||
public class Fill extends Element {
|
||||
private final boolean left;
|
||||
private final boolean top;
|
||||
|
@ -36,11 +39,19 @@ public class Fill extends Element {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected boolean isTextCenteredX() {
|
||||
return !this.left;
|
||||
}
|
||||
// protected boolean isTextCenteredX() {
|
||||
// return !this.left;
|
||||
// }
|
||||
//
|
||||
// protected boolean isTextCenteredY() {
|
||||
// return !this.top;
|
||||
// }
|
||||
|
||||
protected boolean isTextCenteredY() {
|
||||
return !this.top;
|
||||
public void updateText() {
|
||||
Vec2i size = Drawing.getSize(this.text);
|
||||
if(!this.left)
|
||||
this.text_x = (this.size_x - size.xpos) / 2;
|
||||
if(!this.top)
|
||||
this.text_y = (this.size_y - size.ypos) / 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue