【发布时间】:2015-09-22 20:33:23
【问题描述】:
我正在使用Python Cocos2D game library,在their docs 中,您可以找到cocos.text.Label,它接受color=RGBA(int, int, int, int) 作为参数。我有以下代码创建一个标签:
self.name = cocos.text.Label("Test Label",
font_name='Times New Roman',
font_size=22,
color=(163, 42, 44, 1),
anchor_x='center', anchor_y='center')
self.name.position = (10, 90)
self.add(self.name)
此代码附加到cocos.layer.Layer 并在导演启动的场景中呈现。
问题是这样的:如果我从标签中删除color 参数,标签将正确创建并显示为白色,但如果指定颜色,则标签永远不会呈现。甚至没有黑色,它只是不存在。
非常感谢任何有关为什么会发生这种情况以及如何更改标签颜色的帮助。
我正在使用 python 3.4.3 和最新版本的 python-cocos2d。我愿意更新和发布任何代码,所以请随时提问。提前致谢。
【问题讨论】: