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


Python Menu.nameOfSelectedBox方法代码示例

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


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

示例1: Person

# 需要导入模块: from Menu import Menu [as 别名]
# 或者: from Menu.Menu import nameOfSelectedBox [as 别名]

#.........这里部分代码省略.........
		
	def wasClickedOn(self,map):
		if self.rect.collidepoint(map['coords']) == True and map['button'] == 'down':
			self.clicked = True
			self.clickedSpot = map['coords']
			
	def rightClick(self,map):
		# print "self.rect is: ", self.rect
		# print "mouse is at: ",map['coords']
		# print "self.rect.collidepoint(map['coords']) is: ",self.rect.collidepoint(map['coords'])
		# print "map['button3'] is: ", map['button3']
		# print "map['button'] is: ",map['button']
	
		if self.rect.collidepoint(map['coords']) == True and map['button3']== True and map['button'] == 'down':
			self.rightButton = True
			self.clickedSpot = map['coords']
			
	def rightClicked(self):
		return self.rightButton
			
			
	def clickedOn(self):
		return self.clicked
			
	def set_clickedOn_to_false(self):
		self.clicked = False
		
	def closingClick(self,map):
		if self.clicked == True and self.rect.collidepoint(map['coords']) == True and map['button'] == 'down' and map['button3'] == True:
				return True 

				
	def runWalkingPath(self):
		if self.menu.nameOfSelectedBox() == "walking":
			return True
		else:
			return False
		

	def getMenu(self,map):
		#print "1 ----"
		'''getMenu checks to see if you clicked on something on the menu. 
	
		   if you did, it sets clicked to false, so that on the next screen update, the menu
		   will not appear. '''
	
		if self.menu.clickedOn(map): #menu.clickedOn returns true if you clicked on one of the squares, and false otherwise
			self.clicked = False
		return self.menu.currentMenu(map,self.clickedSpot) #returns the current menu
		
		
		#is used to prevent making circles in the exact same place

			
	def selected(self):
		#print self.menu.selectedBox()
		temp = self.menu.selectedBox()
		##print "temp is: ",temp
		#self.setLTSelected(temp)
		return temp
		
	def resetSelected(self):
		return self.menu.resetSelectedBox()
		
	# def setLTSelected(self,string):# set long term selected
		# self.LTSelectedString = string
开发者ID:MichaelHaendler,项目名称:python_video_game1,代码行数:70,代码来源:Person.py


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