改变形状的文本 [英] Change text on shape
问题描述
喜
是有可能改变的形状的文字?我有:
Hi is it possible to change the text of a shape? I have:
levelFraction = new Text(0, 300, mFont, "text", HorizontalAlign.CENTER);
然后我把它添加到场景:
then I add it to the scene:
scene.getTopLayer().addEntity(levelFraction);
但我没有看到在运行时更改文本的任何方法。是这样的:
but I don't see any method to change the text at runtime. Something like:
levelFraction.setText(...);
这可能吗?
推荐答案
我不知道有关AndEngine库什么,所以这也只是胡乱猜测:
I don't know anything about the AndEngine library, so this would just be a wild guess:
您也许可以使用 ChangeableText
(延伸文本
)代替文本
?从名字听起来好像你应该能够更改文本,并在$ C $寻找c那么它也有一对夫妇的功能设置文本:<一href=\"http://$c$c.google.com/p/andengine/source/browse/src/org/anddev/andengine/entity/text/ChangeableText.java\"相对=nofollow> ChangeableText源
Could you perhaps use the ChangeableText
(which extends Text
) instead of Text
? From the name it sounds like you should be able to change the text, and looking at the code it also have a couple of functions to set the text: ChangeableText source
这篇关于改变形状的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!