本文整理汇总了Python中direct.gui.DirectGui.DirectButton.unstash方法的典型用法代码示例。如果您正苦于以下问题:Python DirectButton.unstash方法的具体用法?Python DirectButton.unstash怎么用?Python DirectButton.unstash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.gui.DirectGui.DirectButton
的用法示例。
在下文中一共展示了DirectButton.unstash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DistributedPartyTrampolineActivity
# 需要导入模块: from direct.gui.DirectGui import DirectButton [as 别名]
# 或者: from direct.gui.DirectGui.DirectButton import unstash [as 别名]
#.........这里部分代码省略.........
base.setCellsActive(base.bottomCells, True)
self.accept('arrow_left', self.onLeft)
self.accept('arrow_left-up', self.onLeftUp)
self.accept('arrow_right', self.onRight)
self.accept('arrow_right-up', self.onRightUp)
self.beginRoundInterval = Sequence(Func(self._showFlashMessage, TTLocalizer.PartyTrampolineReady), Wait(1.2), Func(self.flashMessage, TTLocalizer.PartyTrampolineGo), Func(self.beginRound))
self.beginRoundInterval.start()
return
def finishActive(self):
DistributedPartyTrampolineActivity.notify.debug('finishActive')
if self.doJellyBeans:
self.cleanupJellyBeans()
def setupJellyBeans(self):
self.beanAnims = []
self.beansToCollect = []
self.beanDetails = []
self.numBeansCollected = 0
for i in xrange(self.numJellyBeans):
bean = self.beans[i]
guiBean = self.guiBeans[i]
height = self.jellyBeanPositions[i]
color = random.choice(self.jellyBeanColors)
bean.find('**/jellybean').setColor(color)
if self.toon.doId == base.localAvatar.doId:
bean.setAlphaScale(1.0)
else:
bean.setAlphaScale(0.5)
guiBean.setColor(color)
bean.setZ(height + self.toon.getHeight() + self.beanOffset)
guiBean.setZ(height * self.indicatorFactor + self.guiBeanOffset)
bean.setH(0.0)
bean.unstash()
guiBean.unstash()
beanAnim = bean.hprInterval(1.5, VBase3((i % 2 * 2 - 1) * 360.0, 0.0, 0.0))
beanAnim.loop()
self.beanAnims.append(beanAnim)
self.beanDetails.append((height,
bean,
guiBean,
beanAnim))
self.beansToCollect = range(self.numJellyBeans)
def cleanupJellyBeans(self):
for bean in self.beans:
bean.stash()
for guiBean in self.guiBeans:
guiBean.stash()
if hasattr(self, 'beanAnims'):
for beanAnim in self.beanAnims:
beanAnim.finish()
del self.beanAnims
del self.beansToCollect
def beginRound(self):
base.playSfx(self.whistleSound)
self.timer.setTime(PartyGlobals.TrampolineDuration)
self.timer.countdown(PartyGlobals.TrampolineDuration)
self.timer.show()
self.gui.show()
self.quitEarlyButton.unstash()