本文整理汇总了Python中toontown.parties.PartyUtils.getNewToontownTimer方法的典型用法代码示例。如果您正苦于以下问题:Python PartyUtils.getNewToontownTimer方法的具体用法?Python PartyUtils.getNewToontownTimer怎么用?Python PartyUtils.getNewToontownTimer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.parties.PartyUtils
的用法示例。
在下文中一共展示了PartyUtils.getNewToontownTimer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadGUI
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import getNewToontownTimer [as 别名]
def loadGUI(self):
self.gui = loader.loadModel('phase_13/models/parties/trampolineGUI')
self.gui.reparentTo(base.a2dTopLeft)
self.gui.setPos(0.115, 0, -1)
self.gui.hide()
self.toonIndicator = self.gui.find('**/trampolineGUI_MovingBar')
jumpLineLocator = self.gui.find('**/jumpLine_locator')
guiBean = self.gui.find('**/trampolineGUI_GreenJellyBean')
self.gui.find('**/trampolineGUI_GreenJellyBean').stash()
self.guiBeans = [ guiBean.instanceUnderNode(jumpLineLocator, self.uniqueName('guiBean%d' % i)) for i in xrange(self.numJellyBeans) ]
self.guiBeans[-1].setScale(1.5)
heightTextNode = TextNode(self.uniqueName('TrampolineActivity.heightTextNode'))
heightTextNode.setFont(ToontownGlobals.getSignFont())
heightTextNode.setAlign(TextNode.ALeft)
heightTextNode.setText('0.0')
heightTextNode.setShadow(0.05, 0.05)
heightTextNode.setShadowColor(0.0, 0.0, 0.0, 1.0)
heightTextNode.setTextColor(1.0, 1.0, 1.0, 1.0)
self.heightText = jumpLineLocator.attachNewNode(heightTextNode)
self.heightText.setX(0.15)
self.heightText.setScale(0.1)
self.heightText.setAlphaScale(0.0)
self.quitEarlyButtonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui')
quitEarlyUp = self.quitEarlyButtonModels.find('**//InventoryButtonUp')
quitEarlyDown = self.quitEarlyButtonModels.find('**/InventoryButtonDown')
quitEarlyRollover = self.quitEarlyButtonModels.find('**/InventoryButtonRollover')
self.quitEarlyButton = DirectButton(parent=base.a2dTopRight, relief=None, text=TTLocalizer.PartyTrampolineQuitEarlyButton, text_fg=(1, 1, 0.65, 1), text_pos=(0, -0.23), text_scale=0.7, image=(quitEarlyUp, quitEarlyDown, quitEarlyRollover), image_color=(1, 0, 0, 1), image_scale=(20, 1, 11), pos=(-0.183, 0, -0.4), scale=0.09, command=self.leaveTrampoline)
self.quitEarlyButton.stash()
self.flashText = OnscreenText(text='', pos=(0.0, -0.45), scale=0.2, fg=(1.0, 1.0, 0.65, 1.0), align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
self.timer = PartyUtils.getNewToontownTimer()
self.timer.posInTopRightCorner()
return
示例2: load
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import getNewToontownTimer [as 别名]
def load(self):
if self.__loaded:
return
self.__timerPad = PartyUtils.getNewToontownTimer()
guiModel = 'phase_4/models/gui/cannon_game_gui'
guiNode = loader.loadModel(guiModel)
self.__aimPad = DirectFrame(image=guiNode.find('**/CannonFire_PAD'), relief=None, pos=(0.7, 0, -0.553333), scale=0.8)
guiNode.removeNode()
self.fireButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Fire_Btn_UP'), (guiModel, '**/Fire_Btn_DN'), (guiModel, '**/Fire_Btn_RLVR')), relief=None, pos=(0.0115741, 0, 0.00505051), scale=1.0, command=self.__firePressed)
self.upButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(0.0115741, 0, 0.221717))
self.downButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(0.0136112, 0, -0.210101), image_hpr=(0, 0, 180))
self.leftButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(-0.199352, 0, -0.000505269), image_hpr=(0, 0, -90))
self.rightButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(0.219167, 0, -0.00101024), image_hpr=(0, 0, 90))
self.__aimPad.setColor(1, 1, 1, 0.9)
def bindButton(button, upHandler, downHandler):
button.bind(DGG.B1PRESS, lambda x, handler = upHandler: handler())
button.bind(DGG.B1RELEASE, lambda x, handler = downHandler: handler())
bindButton(self.upButton, self.__upPressed, self.__upReleased)
bindButton(self.downButton, self.__downPressed, self.__downReleased)
bindButton(self.leftButton, self.__leftPressed, self.__leftReleased)
bindButton(self.rightButton, self.__rightPressed, self.__rightReleased)
self.__loaded = True
return
示例3: load
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import getNewToontownTimer [as 别名]
def load(self):
if self.isLoaded():
return
guiNode = loader.loadModel('phase_13/models/parties/jukeboxGUI')
self._timerGui = PartyUtils.getNewToontownTimer()
self._windowFrame = DirectFrame(image=guiNode.find('**/background'), relief=None, pos=(0, 0, 0), scale=0.7)
self._songFrame = DirectFrame(image=guiNode.find('**/songTitle_background'), parent=self._windowFrame, relief=None)
self._currentlyPlayingLabel = self.__createLabel(guiNode, 'currentlyPlaying', parent=self._windowFrame, text=TTLocalizer.JukeboxCurrentlyPlayingNothing, scale=TTLocalizer.JGcurrentlyPlayingLabel)
self._songNameLabel = self.__createLabel(guiNode, 'songName', parent=self._windowFrame, text=TTLocalizer.JukeboxCurrentSongNothing, scale=TTLocalizer.JGsongNameLabel)
self._queueList, self._queueLabel = self.__createLabeledScrolledList(guiNode, 'queue', label=TTLocalizer.JukeboxQueueLabel, parent=self._windowFrame)
self._songsList, self._songsLabel = self.__createLabeledScrolledList(guiNode, 'songs', label=TTLocalizer.JukeboxSongsLabel, parent=self._windowFrame)
pos = guiNode.find('**/addButton_text_locator').getPos()
self._addSongButton = self.__createButton(guiNode, 'addSongButton', parent=self._windowFrame, command=self.__handleAddSongButtonClick, image3_color=Vec4(0.6, 0.6, 0.6, 0.6), text=TTLocalizer.JukeboxAddSong, text_align=TextNode.ACenter, text_pos=(pos[0], pos[2]), text_scale=TTLocalizer.JGaddSongButton)
self._closeButton = self.__createButton(guiNode, 'can_cancelButton', parent=self._windowFrame, command=self.__handleCloseButtonClick)
pos = guiNode.find('**/close_text_locator').getPos()
self._closeButton = self.__createButton(guiNode, 'close', parent=self._windowFrame, command=self.__handleCloseButtonClick, text=TTLocalizer.JukeboxClose, text_align=TextNode.ACenter, text_pos=(pos[0], pos[2]), text_scale=0.08)
self._moveToTopButton = self.__createButton(guiNode, 'moveToTop', command=self.__handleMoveToTopButtonClick)
guiNode.removeNode()
self._loaded = True
示例4: load
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import getNewToontownTimer [as 别名]
def load(self):
buttonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui')
upButton = buttonModels.find('**//InventoryButtonUp')
downButton = buttonModels.find('**/InventoryButtonDown')
rolloverButton = buttonModels.find('**/InventoryButtonRollover')
self.exitButton = DirectButton(relief=None, text=TTLocalizer.PartyTeamActivityExitButton, text_fg=(1, 1, 0.65, 1), text_pos=(0, -0.15), text_scale=0.5, image=(upButton, downButton, rolloverButton), image_color=(1, 0, 0, 1), image_scale=(14.5, 1, 9), pos=(0, 0, 0.8), scale=0.15, command=self.handleExitButtonClick)
self.exitButton.hide()
if self.activity.toonsCanSwitchTeams():
self.switchButton = DirectButton(relief=None, text=TTLocalizer.PartyTeamActivitySwitchTeamsButton, text_fg=(1, 1, 1, 1), text_pos=(0, 0.1), text_scale=0.5, image=(upButton, downButton, rolloverButton), image_color=(0, 1, 0, 1), image_scale=(15, 1, 15), pos=(0, 0, 0.5), scale=0.15, command=self.handleSwitchButtonClick)
self.switchButton.hide()
else:
self.switchButton = None
buttonModels.removeNode()
self.countdownText = OnscreenText(text='', pos=(0.0, -0.2), scale=PartyGlobals.TeamActivityTextScale * 1.2, fg=(1.0, 1.0, 0.65, 1.0), align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
self.countdownText.hide()
self.statusText = OnscreenText(text='', pos=(0.0, 0.0), scale=PartyGlobals.TeamActivityTextScale, fg=PartyGlobals.TeamActivityStatusColor, align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
self.statusText.hide()
self.timer = PartyUtils.getNewToontownTimer()
self.timer.hide()
return