本文整理汇总了Python中cocos.text.Label.visible方法的典型用法代码示例。如果您正苦于以下问题:Python Label.visible方法的具体用法?Python Label.visible怎么用?Python Label.visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cocos.text.Label
的用法示例。
在下文中一共展示了Label.visible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from cocos.text import Label [as 别名]
# 或者: from cocos.text.Label import visible [as 别名]
def __init__(self):
super(RulersLayer, self).__init__()
self._kCCBRulerWidth = 15
self._stageOrigin = [0,0]
self._winSize = [0,0]
self._zoom = 1.0
# TODO:@twenty0ne
# CCScale9Sprite
bgVertical = Sprite('images/ruler-bg-vertical.png')
# TODO:@twenty0ne
# notice image_anchor, anchor, transform_anchor difference
bgVertical.image_anchor = 0,0
self.add(bgVertical)
self._bgVertical = bgVertical
bgHorizontal = Sprite('images/ruler-bg-horizontal.png')
bgHorizontal.image_anchor = 0,0
self.add(bgHorizontal, z=2)
self._bgHorizontal = bgHorizontal
marksVertical = CocosNode()
self.add(marksVertical, z=1)
self._marksVertical = marksVertical
marksHorizontal = CocosNode()
self.add(marksHorizontal, z=3)
self._marksHorizontal = marksHorizontal
mouseMarkVertical = Sprite('images/ruler-guide.png')
mouseMarkVertical.image_anchor = 0,0.5
mouseMarkVertical.visible = False
self.add(mouseMarkVertical, z=4)
self._mouseMarkVertical = mouseMarkVertical
mouseMarkHorizontal = Sprite('images/ruler-guide.png')
mouseMarkHorizontal.rotation = -90
mouseMarkHorizontal.image_anchor = 0,0.5
mouseMarkHorizontal.visible = False
self.add(mouseMarkHorizontal, z=4)
self._mouseMarkHorizontal = mouseMarkHorizontal
xyBg = Sprite('images/ruler-xy.png')
xyBg.image_anchor = 0,0
xyBg.position = 0,0
self.add(xyBg, z=5)
lblX = Label("0", position=(40,3), color=(0,0,0,255), font_size=8, anchor_x="right")
#lblX.anchor = 1,0
#lblX.position = 47,3
lblX.visible = False
self.add(lblX, z=6)
self._lblX = lblX
lblY = Label("0", position=(90,3), color=(0,0,0,255), font_size=8, anchor_x="right")
#lblY.anchor = 1,0
#lblY.position = 97,3
lblY.visible = False
self.add(lblY, z=6)
self._lblY = lblY