Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 textfield的一部分正在消失_Actionscript 3_Textfield - Fatal编程技术网

Actionscript 3 textfield的一部分正在消失

Actionscript 3 textfield的一部分正在消失,actionscript-3,textfield,Actionscript 3,Textfield,所以我在AS3程序中有两个文本字段。其中一个显示得很好,另一个在半路被切断了,你知道是什么原因造成的吗?它们是用所有相同的参数创建的(除了它们有不同的文本) 很抱歉,缺少细节 var tf1 = new TextField(); tf1.text = "You scored: " + score + " points"; tf1.x = miscellaneousObjects[0].x + 50; tf1.y = miscellaneousObjects[0].y + 50; tf1.text

所以我在AS3程序中有两个文本字段。其中一个显示得很好,另一个在半路被切断了,你知道是什么原因造成的吗?它们是用所有相同的参数创建的(除了它们有不同的文本)

很抱歉,缺少细节

var tf1 = new TextField();
tf1.text = "You scored: " + score + " points";
tf1.x = miscellaneousObjects[0].x + 50;
tf1.y = miscellaneousObjects[0].y + 50;
tf1.textColor = 0xFFFFFF;
tf1.setTextFormat(myTextFormat);
uiTextLayer.addChild(tf1);
var tf2 = new TextField();
tf2.text = "Would you like to play again?";
tf2.x = miscellaneousObjects[0].x + 50;
tf2.y = miscellaneousObjects[0].y + 80;
tf2.textColor = 0xFFFFFF;
tf2.setTextFormat(myTextFormat);
uiTextLayer.addChild(tf2);

miscelleanousObjects[0]指的是应该围绕文本的框的图像。正如您所见,它们的创建完全相同。

文本字段默认为100像素乘以100像素的大小。尝试显式设置文本字段的宽度:

tf1.width = 500;
tf2.width = 500;
使用


它们是用AS3动态生成的还是仅仅由脚本控制的?如果您提供一些示例代码,您会得到更具体的帮助。总的来说,这是一项需要学习的有用技能——将问题简化为能够再现问题的最小代码片段。太模糊了,任何人都无法回答。当然,发布两个文本字段的代码并不难。相同的字体?嵌入字体?只是大写字母不见了吗?多线?
tf1.autoSize = TextFieldAutoSize.LEFT;
tf2.autoSize = TextFieldAutoSize.LEFT;