我有这个代码。它在舞台上创建了两行文本,但是当舞台重新调整大小时,第二行文本可能会在舞台缩放时消失。有谁知道为什么会这样?提前谢谢你的帮助!
var text:TextField=new TextField();
var textFormat:TextFormat = new TextFormat();
textFormat.color=0x000000;
textFormat.size=45;
textFormat.bold=true;
textFormat.font="Impact";
textFormat.italic=true;
text.x=8;
text.y=5;
text.width=200;
text.text = "Line One\nLine two";
text.setTextFormat(textFormat);
text.height=text.textHeight +4;
sprite.addChild(text);
然后将精灵添加到舞台上。