本文整理汇总了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)
示例2: setupInterface
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def setupInterface(self):
MenuManager.get("Main").activate()
示例3: onSingleEventButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onSingleEventButtonClicked(self, args):
self.switchTo(MenuManager.get("TrackSelect"))
示例4: onQuickRaceButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onQuickRaceButtonClicked(self, args):
self.switchTo(MenuManager.get("TrackSelect"))
示例5: onOptionsButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onOptionsButtonClicked(self, args):
self.switchTo(MenuManager.get("Options"))
示例6: onProfilesButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onProfilesButtonClicked(self, args):
self.switchTo(MenuManager.get("Profiles"))
示例7: onCreditsButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onCreditsButtonClicked(self, args):
self.switchTo(MenuManager.get("Credits"))
示例8: onContinueButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onContinueButtonClicked(self, args):
self.switchTo(MenuManager.get("Main"))
示例9: onStartButtonClicked
# 需要导入模块: from menumanager import MenuManager [as 别名]
# 或者: from menumanager.MenuManager import get [as 别名]
def onStartButtonClicked(self, args):
self.switchTo(MenuManager.get("Loading"))