|
@@ -130,7 +130,7 @@ export class BaseGameUI extends BaseUI {
|
|
|
}
|
|
|
}
|
|
|
let labelNode = cc.find('label', node)
|
|
|
- let label
|
|
|
+ let label: cc.Label
|
|
|
if (data.lb) {
|
|
|
if (!labelNode) {
|
|
|
labelNode = new cc.Node()
|
|
@@ -144,6 +144,9 @@ export class BaseGameUI extends BaseUI {
|
|
|
label.string = data.lb
|
|
|
label.fontSize = data.fontSize
|
|
|
label.lineHeight = data.fontSize
|
|
|
+ label.verticalAlign = cc.Label.VerticalAlign.CENTER
|
|
|
+ label.horizontalAlign = cc.Label.HorizontalAlign.CENTER
|
|
|
+ // @ts-ignore
|
|
|
label._forceUpdateRenderData(true)
|
|
|
node.width = labelNode.width
|
|
|
node.height = labelNode.height
|