Commit b4f85ada authored by 李维's avatar 李维

dev commit

parent 0a0c19de
......@@ -392,12 +392,11 @@ export class PlayComponent implements OnInit, OnDestroy {
textContainer.alpha = 0
let text = this.g_cartoon.createLabel(data.text, "BerlinSansFBDemi-Bold", null, 50)
let lineNum = data.text.split(" ").length
console.log(lineNum)
let lineNum = data.text.split(" ")
text.maxSingalLineWidth = 165
text.fontColor = "#e05e14";
if(lineNum>1){
textContainer.y = -(lineNum * 50) / 2 + 50
if(lineNum.length>1){
textContainer.y = -(lineNum.length * 50) / 2 + 50
}
textContainer.addChild(text)
......
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