Skip to content
Snippets Groups Projects
Verified Commit 3ca212a3 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Center text on button

parent a5dc6604
No related tags found
1 merge request!7Draft: Resolve "Beautify menu fonts and forms"
Pipeline #7395 passed
......@@ -33,8 +33,8 @@ class Button extends TiledWidgetContainer {
];
super(form, 'uipack', tileMap, tilesX, tilesY, containerX, containerY, children);
const text = form.scene.add.text(this.margin, this.margin, button.label);
text.setOrigin(0, 0);
const text = form.scene.add.text(this.width / 2, this.height / 2, button.label);
text.setOrigin(0.5, 0.5);
this.add(text);
const buttonOverlay = new RexButton(this, button.config);
buttonOverlay.on('click', button.callback);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment