当前位置: 首页>>代码示例>>Python>>正文


Python TextNode.setFrameAsMargin方法代码示例

本文整理汇总了Python中panda3d.core.TextNode.setFrameAsMargin方法的典型用法代码示例。如果您正苦于以下问题:Python TextNode.setFrameAsMargin方法的具体用法?Python TextNode.setFrameAsMargin怎么用?Python TextNode.setFrameAsMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在panda3d.core.TextNode的用法示例。


在下文中一共展示了TextNode.setFrameAsMargin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MyApp

# 需要导入模块: from panda3d.core import TextNode [as 别名]
# 或者: from panda3d.core.TextNode import setFrameAsMargin [as 别名]

#.........这里部分代码省略.........
        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')

	#print "Hello"
开发者ID:sandeep-daiict,项目名称:Recycling-Revolution,代码行数:70,代码来源:main.py


注:本文中的panda3d.core.TextNode.setFrameAsMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。