本文整理汇总了Python中panda3d.core.TextNode.setFrameLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Python TextNode.setFrameLineWidth方法的具体用法?Python TextNode.setFrameLineWidth怎么用?Python TextNode.setFrameLineWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.TextNode
的用法示例。
在下文中一共展示了TextNode.setFrameLineWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkIfEccoDied
# 需要导入模块: from panda3d.core import TextNode [as 别名]
# 或者: from panda3d.core.TextNode import setFrameLineWidth [as 别名]
def checkIfEccoDied(self):
print "position" + str(self.pos.getY())
if self.pos.getZ() > -50.0 and self.pos.getZ() < 0.0:
title = "Game Over"
levelCompleteN = TextNode('ecco-died')
font = loader.loadFont("font/Caveman.ttf")
levelCompleteN.setFont(font)
levelCompleteN.setText(title)
levelCompleteN.setTextColor(1, 1, 1, 1)
levelCompleteN.setSlant(0.1)
levelCompleteN.setShadow(0.03)
levelCompleteN.setShadowColor(0, 0, 200, 1)
# levelN.setFrameAsMargin(0, 0, 0, 0)
levelCompleteN.setFrameColor(200, 0, 0, 1)
levelCompleteN.setFrameLineWidth(5.0)
# textNp.node().setGlyphShift(1.0)
textNodePath = self.aspect2d.attachNewNode(levelCompleteN)
textNodePath.setPos(-0.9, 1.5, 0.5)
textNodePath.setScale(0.2)
if self.pos.getZ() < -49.0:
self.gameOverSound.play()
elif self.pos.getZ() < -50.0:
if self.gameOverSound.status() != self.gameOverSound.PLAYING:
sys.exit(1)
elif self.pos.getY() > 1300.0:
title = "Level 1 \n Complete"
levelCompleteN = TextNode('level-complete')
font = loader.loadFont("font/Caveman.ttf")
levelCompleteN.setFont(font)
levelCompleteN.setText(title)
levelCompleteN.setTextColor(1, 1, 1, 1)
levelCompleteN.setSlant(0.1)
levelCompleteN.setShadow(0.03)
levelCompleteN.setShadowColor(0, 0, 200, 1)
# levelN.setFrameAsMargin(0, 0, 0, 0)
levelCompleteN.setFrameColor(200, 0, 0, 1)
levelCompleteN.setFrameLineWidth(5.0)
# textNp.node().setGlyphShift(1.0)
textNodePath = self.aspect2d.attachNewNode(levelCompleteN)
textNodePath.setPos(-0.6, 1.5, 0.5)
textNodePath.setScale(0.2)
if self.levelCompleteSound.status() != self.levelCompleteSound.PLAYING:
self.levelCompleteSound.play()
else:
pass
示例2: __init__
# 需要导入模块: from panda3d.core import TextNode [as 别名]
# 或者: from panda3d.core.TextNode import setFrameLineWidth [as 别名]
def __init__(self):
ShowBase.__init__(self)
base.setBackgroundColor(0, 0, 0)
game_title = "ECCO"
titleN = TextNode('game-title')
font = loader.loadFont("font/Caveman.ttf")
titleN.setFont(font)
titleN.setText(game_title)
titleN.setTextColor(1, 1, 1, 1)
titleN.setSlant(0.1)
titleN.setShadow(0.05)
titleN.setShadowColor(0, 0, 200, 1)
titleN.setFrameColor(0, 0, 255, 1)
titleN.setFrameLineWidth(5.0)
textNodePath = self.aspect2d.attachNewNode(titleN)
textNodePath.setPos(-0.4, 1.5, 0.5)
textNodePath.setScale(0.2)
self.level1Button = DirectButton(text=("Level 1"), scale=.1, pos=(0, 0, 0.2), command=self.level1)
self.level2Button = DirectButton(text=("Level 2"), scale=.1, pos=(0, 0, 0), command=self.level2)