本文整理汇总了Python中panda3d.core.TextNode.setFrameColor方法的典型用法代码示例。如果您正苦于以下问题:Python TextNode.setFrameColor方法的具体用法?Python TextNode.setFrameColor怎么用?Python TextNode.setFrameColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.TextNode
的用法示例。
在下文中一共展示了TextNode.setFrameColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkIfEccoDied
# 需要导入模块: from panda3d.core import TextNode [as 别名]
# 或者: from panda3d.core.TextNode import setFrameColor [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 setFrameColor [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)
示例3: MyApp
# 需要导入模块: from panda3d.core import TextNode [as 别名]
# 或者: from panda3d.core.TextNode import setFrameColor [as 别名]
#.........这里部分代码省略.........
pandaPosInterval52= self.Truck[5].posInterval(12,Point3(-276,-282,0), startPos=Point3(-268,280,0))
pandaPosInterval53= self.Truck[5].posInterval(12,Point3(298,-282,0), startPos=Point3(-276,-282,0))
pandaPosInterval54= self.Truck[5].posInterval(12,Point3(286,280,0), startPos=Point3(298,-282,0))
#pandaPosInterval55= self.Truck[5].posInterval(13,Point3(-396,10,0), startPos=Point3(-123,-6,0))
#pandaPosInterval6=self.Truck[0].posInterval(1,Point3(21,390,0),startPos=Point3(-10,-399,0)
#pandaHprInterval50= self.Truck[5].hprInterval(1,Point3(90,0,0), startHpr=Point3(0,0,0))
pandaHprInterval51= self.Truck[5].hprInterval(3,Point3(90,0,0), startHpr=Point3(0,0,0))
pandaHprInterval52= self.Truck[5].hprInterval(3,Point3(180,0,0), startHpr=Point3(90,0,0))
pandaHprInterval53= self.Truck[5].hprInterval(3,Point3(-90,0,0), startHpr=Point3(0,0,0))
pandaHprInterval54= self.Truck[5].hprInterval(3,Point3(0,0,0), startHpr=Point3(-90,0,0))
#pandaHprInterva5= self.Truck[0].hprInterval(3,Point3(180,0,0), startHpr=Point3(0,0,0))
#Create and play the sequence that coordinates the intervals
pandaPace6 = Sequence(pandaHprInterval51,pandaPosInterval51, pandaHprInterval52,
pandaPosInterval52, pandaHprInterval53,pandaPosInterval53,pandaHprInterval54,pandaPosInterval54, name = "pandaPace6")
pandaPace6.loop()
def Game_Point(self):
self.ignore("arrow_down")
self.ignore("arrow_up")
self.ignore("arrow_down-repeat")
self.ignore("arrow_up-repeat")
#self.text1 = addInstructions(0.5,"Is this Recyclable")
self.text1 = TextNode('t1')
self.text1.setText("is This Recyclable")
self.text1.setTextColor(0,0,0,1)
self.textNodePath1 = aspect2d.attachNewNode(self.text1)
self.textNodePath1.setScale(0.07)
self.textNodePath1.setPos(-0.1,-0.1,0.1)
#text1.setTextColor(1,1,1)
self.text1.setFrameColor(1, 0, 0, 1)
self.text1.setFrameAsMargin(0.2, 0.2, 0.1, 0.1)
self.text2 = TextNode('t2')
self.text2.setText("Y/N")
self.text2.setTextColor(0,0,0,1)
self.textNodePath2 = aspect2d.attachNewNode(self.text2)
self.textNodePath2.setScale(0.07)
self.textNodePath2.setPos(0,0,0)
#textNodePath2.setTextColor(1,1,1)
self.text2.setFrameColor(1, 0, 0, 1)
self.text2.setFrameAsMargin(0.2, 0.2, 0.1, 0.1)
self.accept('y',self.answer,[0])
self.accept('n',self.answer,[1])
def answer(self,n):
global Num,cor_ans
#print self.ans[Num]
self.accept('arrow_down',self.moved,[0])
self.accept('arrow_up',self.move,[0])
self.accept('arrow_down-repeat',self.moved,[1])
self.accept('arrow_up-repeat',self.move,[1])
aspect2d.getChildren().detach()
if n == 0:
if self.ans[Num] == 'Y':
cor_ans = cor_ans + 1
if n == 1:
if self.ans[Num] == 'N':
#print "Correct"
cor_ans = cor_ans + 1
self.ignore('y')
self.ignore('n')