如何创建一个显示整数和文本的文本字段?
我正在尝试制作一个文本字段来显示玩家的分数。我将文本字段称为“分数”,并希望它显示“玩家分数:[分数]”。
现在,我的代码如下所示:
score.text = String "Player Score:" (scoreValue);
这不起作用,但我觉得它一定非常接近。这样做的正确方法是什么?
I am trying to make a textfield to display the player's score. I call the textfield "score", and want it to display "Player Score: [score]".
Right now, my code looks like this:
score.text = String "Player Score:" (scoreValue);
This isn't working, but I feel that it must be very close. What is the proper method for doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能正在搜索 toString() 函数
应该打印:Player Score: 1234
可能就是您所需要的。
You are probably searching for the toString() function
Should print: Player Score: 1234
is probably what you need.