Commit 5198910d authored by Chen Jiping's avatar Chen Jiping

fix:修复标题显示的问题

parent cfdd1e33
......@@ -325,20 +325,22 @@ cc.Class({
label.font = cc.find('Canvas/res/font/FatMarker').getComponent(cc.Label).font;
label.string = `<size=${size}><color=#6e160c>${this.data.title.val}</color></size>`
label.horizontalAlign = cc.macro.TextAlignment.LEFT
labelNode.anchorX = 0;
labelNode.anchorX = 0.5;
labelNode.anchorY = 0.5;
labelNode.rotation = -3;
labelNode.x = (titleBgNode.width - labelNode.width) / 2;
labelNode.y = -(titleBgNode.height - labelNode.height) / 2;
this.titleLabel = label;
const maxW = titleBgNode.width * 0.7;
const maxW = titleBgNode.width * 0.65;
if (labelNode.width > maxW) {
labelNode.scale = maxW / labelNode.width;
}
labelNode.x = titleBgNode.width / 2 - 20 * this._cocosScale;
labelNode.y = -(titleBgNode.height - labelNode.height) / 2;
titleBgNode.addComponent(cc.Button);
titleBgNode.on('click', () => {
this.playAudioByUrl(this.data.title.audioUrl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment