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


Python MenuManager.get方法代码示例

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


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

示例1: onUpdate

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onUpdate(self, args):

		Menu.onUpdate(self, args)

		sinceAct = (self.currTime - self.actTime) / 1000.0
		
		#print("Since=%.2f, curr=%d" % (sinceAct, self.curInd))

		if self.curInd < 0 \
		   or (sinceAct > self.Messages[self.curInd].time + self.Messages[self.curInd].dur):

			# Next message : if none left, wait a little, and then switch to next menu. 
			if self.curInd == len(self.Messages) - 1:

				if sinceAct > self.Messages[self.curInd].time + self.Messages[self.curInd].dur + 2.0:
					self.switchTo(MenuManager.get("Results"))
				else:
					self.prbProgress.hide()
					time.sleep(0.01) # Let the CPU keep cool (no hurry).

			# Next message : if at least one left ... 
			else:

				self.curInd = self.curInd + 1
				
				# Create and add the static text for the new message.
				scpItem = PyCEGUI.WindowManager.getSingleton().createWindow("CEGUIDemo/StaticText", "MenuLoading/ScpMessages/Msg%d" % self.curInd)
				scpItem.setText(self.Messages[self.curInd].txt + " ...")
				scpItem.setProperty("FrameEnabled", "false")
				scpItem.setProperty("BackgroundEnabled", "false")
				scpItem.setXPosition(PyCEGUI.UDim(0.0, 0.0))
				scpItem.setYPosition(PyCEGUI.UDim(1.0 + self.curInd * 0.10, 0.0))
				scpItem.setWidth(PyCEGUI.UDim(1.0, 0.0))
				scpItem.setHeight(PyCEGUI.UDim(0.10, 0.0))
				self.scpMessages.addChildWindow(scpItem)

				# Adjust alpha for all messages.
				nChildren = self.scpMessages.getContentPane().getChildCount()
				for chldInd in range(nChildren):
					txtChld = self.scpMessages.getContentPane().getChildAtIdx(chldInd)
					txtChld.setAlpha(0.85 ** (nChildren - 1 - chldInd))
				
				# Scroll down to show the added static text.
				self.scpMessages.setVerticalScrollPosition(1.0)

				# Hide any scrollbar (might get shown after every call to addChildWindow).
				self.scpMessages.getVertScrollbar().hide()
				self.scpMessages.getHorzScrollbar().hide()

				# Reset progress-bar.
				self.prbProgress.setProgress(0)
				self.prbProgress.show()

		else:

			# Update progress-bar.
			progress = (sinceAct - self.Messages[self.curInd].time) / self.Messages[self.curInd].dur
			self.prbProgress.setProgress(progress)
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:60,代码来源:menuloading.py

示例2: setupInterface

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def setupInterface(self):

		MenuManager.get("Main").activate()
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:gui.py

示例3: onSingleEventButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onSingleEventButtonClicked(self, args):

		self.switchTo(MenuManager.get("TrackSelect"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:menumain.py

示例4: onQuickRaceButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onQuickRaceButtonClicked(self, args):

		self.switchTo(MenuManager.get("TrackSelect"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:menumain.py

示例5: onOptionsButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onOptionsButtonClicked(self, args):

		self.switchTo(MenuManager.get("Options"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:menustandard.py

示例6: onProfilesButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onProfilesButtonClicked(self, args):

		self.switchTo(MenuManager.get("Profiles"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:menustandard.py

示例7: onCreditsButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onCreditsButtonClicked(self, args):

		self.switchTo(MenuManager.get("Credits"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:menustandard.py

示例8: onContinueButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onContinueButtonClicked(self, args):

		self.switchTo(MenuManager.get("Main"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:5,代码来源:menuresults.py

示例9: onStartButtonClicked

# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
	def onStartButtonClicked(self, args):

		self.switchTo(MenuManager.get("Loading"))
开发者ID:rongzhou,项目名称:speed-dreams,代码行数:5,代码来源:menucarselect.py


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