Fix: move text position to right with anchor 0.5

This commit is contained in:
2018-12-09 18:15:11 +09:00
parent 8e1779182d
commit 3fd64a35e1
+2 -24
View File
@@ -52,31 +52,9 @@ function TypingAppButton(type, x, y, iconSprite, buttonText, appInfo) {
); );
break; break;
} }
/*
setting.setStrokeColor(
0xffffff, //0x444488,
0x6666aa,
0x6666aa,
0x333333
);
setting.setButtonColor(
0xaaaadd,
0xddddff,
0xddddff,
0x666666
);
setting.setTextColor(
"#844",
"#a66",
"#a66",
"#333"
);
*/
setting.fontStyle = { setting.fontStyle = {
font: "22px Arial", font: "22px Arial",
boundsAlignH: "center", // left, center. right
boundsAlignV: "middle", // top, middle, bottom
fill: "#fff" fill: "#fff"
}; };
@@ -88,13 +66,13 @@ function TypingAppButton(type, x, y, iconSprite, buttonText, appInfo) {
this.clickEvent this.clickEvent
); );
this.text.x = 30; this.text.x = 140;
if(iconSprite != null) { if(iconSprite != null) {
this.icon = iconSprite.sprite; this.icon = iconSprite.sprite;
this.buttonIcon = this.button.addChild(this.icon); this.buttonIcon = this.button.addChild(this.icon);
this.buttonIcon.x = 40; this.buttonIcon.x = 35;
this.buttonIcon.y = this.button.height / 2 - 5; this.buttonIcon.y = this.button.height / 2 - 5;
} }