本文整理汇总了Python中direct.gui.DirectGui.DirectWaitBar.hide方法的典型用法代码示例。如果您正苦于以下问题:Python DirectWaitBar.hide方法的具体用法?Python DirectWaitBar.hide怎么用?Python DirectWaitBar.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.gui.DirectGui.DirectWaitBar
的用法示例。
在下文中一共展示了DirectWaitBar.hide方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Hud
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
class Hud(DirectObject):
def __init__(self):
self.lifeBar1 = DirectWaitBar(
text = "Player1",
text_fg = (1,1,1,1),
text_pos = (-1.2, -0.18, 0),
text_align = TextNode.ALeft,
value = 100,
barColor = (0, 1, 0.25, 1),
barRelief = DGG.RAISED,
barBorderWidth = (0.03, 0.03),
borderWidth = (0.01, 0.01),
relief = DGG.RIDGE,
frameColor = (0.8,0.05,0.10,1),
frameSize = (-1.2, 0, -0.1, 0),
pos = (-0.2,0,base.a2dTop-0.15))
self.lifeBar1.setTransparency(1)
self.lifeBar2 = DirectWaitBar(
text = "Player2",
text_fg = (1,1,1,1),
text_pos = (1.2, -0.18, 0),
text_align = TextNode.ARight,
value = 100,
barColor = (0, 1, 0.25, 1),
barRelief = DGG.RAISED,
barBorderWidth = (0.03, 0.03),
borderWidth = (0.01, 0.01),
relief = DGG.RIDGE,
frameColor = (0.8,0.05,0.10,1),
frameSize = (0, 1.2, -0.1, 0),
pos = (0.2,0,base.a2dTop-0.15))
self.lifeBar2.setTransparency(1)
self.accept("hud_setLifeBarValue", self.setLifeBarValue)
self.hide()
def show(self):
self.lifeBar1["value"] = 100
self.lifeBar2["value"] = 100
self.lifeBar1.show()
self.lifeBar2.show()
def hide(self):
self.lifeBar1.hide()
self.lifeBar2.hide()
def setLifeBarValue(self, barNr, newValue):
if barNr == 0:
self.lifeBar1["value"] = newValue
elif barNr == 1:
self.lifeBar2["value"] = newValue
示例2: ControlPointBar
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
class ControlPointBar(DirectWaitBar):
def __init__(self, barColor=(255,0,0,1), pos=(1.0,0,0.9)):
self.bar = DirectWaitBar(pos = pos, barColor = barColor, text="",
value=0, range=30, frameSize=(-0.3,0.3,0,0.03), frameColor=(0,0,255,1))
def setValue(self, value):
self.bar['value'] = float(value)
def hide(self):
self.bar.hide()
def show(self):
self.bar.show()
示例3: ResourceBar
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
class ResourceBar(DirectWaitBar):
def __init__(self, barColor=(200,180,0,1), pos=(0,0,0.9)):
self.bar = DirectWaitBar(pos = pos, barColor = barColor, text="",
value=70, range=100, frameSize=(-0.3,0.3,0,0.03), frameColor=(0,0,0,1))
def setValue(self, value):
self.bar['value'] = float(value)
def hide(self):
self.bar.hide()
def show(self):
self.bar.show()
示例4: Bar
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
class Bar(DirectObject.DirectObject):
def __init__( self):
self.bar = DirectWaitBar(text = "Loading...", value = 0, pos = (0,.4,.4))
self.bar.hide()
def incBar(self, arg):
self.bar['value'] += arg
#text = str(bar['value'])
#textObject.setText(text)
def show(self):
self.bar.show()
def hide(self):
self.bar.hide()
示例5: ProgressBar
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
class ProgressBar(object):
'''
'''
def __init__(self):
'''
'''
self.__wait_bar = DirectWaitBar( text = "Carregando...",
value = 0,
pos = (0, 0, -.95),
text_scale = 0.05,
text_pos = (0, 0.025),
frameSize = (-1.3, 1.3, 0, 0.08) )
self.hide()
def finish(self):
self.__wait_bar['barColor'] = (0, 1, 0, 1)
self.__wait_bar.setBarColor()
self.__wait_bar.finish()
self.hide()
def hide(self):
self.__wait_bar.hide()
def show(self):
self.__wait_bar.show()
def update(self, value):
if value < 25:
self.__wait_bar['barColor'] = (1, 0, 0, 1)
elif value > 25 and value < 75:
self.__wait_bar['barColor'] = (1, 1, 0, 1)
elif value > 75:
self.__wait_bar['barColor'] = (0, 1, 0, 1)
self.__wait_bar.setBarColor()
self.__wait_bar.update(value)
示例6: ControlPointBar
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
class ControlPointBar(DirectWaitBar):
def __init__(self, barColor=(255,0,0,1), pos=(1.0,0,0.9)):
self.bar = DirectWaitBar(pos = pos, barColor = barColor, text="",
value=70, range=100, frameSize=(-0.3,0.3,0,0.03), frameColor=(0,0,255,1))
def setValue(self, value):
self.bar['value'] = float(value)
self.setPos((0,0,0))
def hide(self):
self.bar.hide()
# to make inherited setPos available for this object
def show(self):
self.bar.show()
# to make inherited setPos available for this object
def setPos(self, pos):
self.bar.setPos(pos)
示例7: DistributedBanquetTable
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
#.........这里部分代码省略.........
head = diner.find("**/joint_head")
newIndicator = DinerStatusIndicator.DinerStatusIndicator(parent=head, pos=Point3(0, 0, 3.5), scale=5.0)
newIndicator.wrtReparentTo(diner)
self.dinerStatusIndicators[i] = newIndicator
return diner
def setupChairCols(self):
for i in xrange(self.numDiners):
chairCol = self.tableGroup.find("**/collision_chair_%d" % (i + 1))
colName = "ChairCol-%d-%d" % (self.index, i)
chairCol.setTag("chairIndex", str(i))
chairCol.setName(colName)
chairCol.setCollideMask(ToontownGlobals.WallBitmask)
self.accept("enter" + colName, self.touchedChair)
def touchedChair(self, colEntry):
chairIndex = int(colEntry.getIntoNodePath().getTag("chairIndex"))
if chairIndex in self.dinerStatus:
status = self.dinerStatus[chairIndex]
if status in (self.HUNGRY, self.ANGRY):
self.boss.localToonTouchedChair(self.index, chairIndex)
def serveFood(self, food, chairIndex):
self.removeFoodModel(chairIndex)
serviceLoc = self.serviceLocs.get(chairIndex)
if not food or food.isEmpty():
foodModel = loader.loadModel("phase_12/models/bossbotHQ/canoffood")
foodModel.setScale(ToontownGlobals.BossbotFoodModelScale)
foodModel.reparentTo(serviceLoc)
else:
food.wrtReparentTo(serviceLoc)
tray = food.find("**/tray")
if not tray.isEmpty():
tray.hide()
ivalDuration = 1.5
foodMoveIval = Parallel(
SoundInterval(self.serveFoodSfx, node=food),
ProjectileInterval(
food, duration=ivalDuration, startPos=food.getPos(serviceLoc), endPos=serviceLoc.getPos(serviceLoc)
),
LerpHprInterval(food, ivalDuration, Point3(0, -360, 0)),
)
intervalName = "serveFood-%d-%d" % (self.index, chairIndex)
foodMoveIval.start()
self.activeIntervals[intervalName] = foodMoveIval
def setDinerStatus(self, chairIndex, status):
if chairIndex in self.dinerStatus:
oldStatus = self.dinerStatus[chairIndex]
self.dinerStatus[chairIndex] = status
if oldStatus != status:
if status == self.EATING:
self.changeDinerToEating(chairIndex)
elif status == self.HUNGRY:
self.changeDinerToHungry(chairIndex)
elif status == self.ANGRY:
self.changeDinerToAngry(chairIndex)
elif status == self.DEAD:
self.changeDinerToDead(chairIndex)
elif status == self.HIDDEN:
self.changeDinerToHidden(chairIndex)
def removeFoodModel(self, chairIndex):
serviceLoc = self.serviceLocs.get(chairIndex)
if serviceLoc:
示例8: DistributedGolfSpot
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
#.........这里部分代码省略.........
gui.find('**/CloseBtn_Rllvr'),
gui.find('**/CloseBtn_UP')), relief=None, scale=2, text=TTLocalizer.BossbotGolfSpotLeave, text_scale=0.04, text_pos=(0, -0.07), text_fg=VBase4(1, 1, 1, 1), pos=(1.05, 0, -0.82), command=self.__exitGolfSpot)
self.accept('escape', self.__exitGolfSpot)
self.accept('control', self.__controlPressed)
self.accept('control-up', self.__controlReleased)
self.accept('InputState-forward', self.__upArrow)
self.accept('InputState-reverse', self.__downArrow)
self.accept('InputState-turnLeft', self.__leftArrow)
self.accept('InputState-turnRight', self.__rightArrow)
taskMgr.add(self.__watchControls, 'watchGolfSpotControls')
taskMgr.doMethodLater(5, self.__displayGolfSpotAdvice, self.golfSpotAdviceName)
self.arrowVert = 0
self.arrowHorz = 0
if self.powerBar:
self.powerBar.show()
return
def __disableControlInterface(self):
if self.closeButton:
self.closeButton.destroy()
self.closeButton = None
self.__cleanupGolfSpotAdvice()
self.ignore('escape')
self.ignore('control')
self.ignore('control-up')
self.ignore('InputState-forward')
self.ignore('InputState-reverse')
self.ignore('InputState-turnLeft')
self.ignore('InputState-turnRight')
self.arrowVert = 0
self.arrowHorz = 0
taskMgr.remove('watchGolfSpotControls')
if self.powerBar:
self.powerBar.hide()
else:
self.notify.debug('self.powerBar is none')
return
def setupPowerBar(self):
self.powerBar = DirectWaitBar(pos=(0.0, 0, -0.94), relief=DGG.SUNKEN, frameSize=(-2.0,
2.0,
-0.2,
0.2), borderWidth=(0.02, 0.02), scale=0.25, range=100, sortOrder=50, frameColor=(0.5, 0.5, 0.5, 0.5), barColor=(1.0, 0.0, 0.0, 1.0), text='', text_scale=0.26, text_fg=(1, 1, 1, 1), text_align=TextNode.ACenter, text_pos=(0, -0.05))
self.power = 0
self.powerBar['value'] = self.power
self.powerBar.hide()
def resetPowerBar(self):
self.power = 0
self.powerBar['value'] = self.power
self.powerBar['text'] = ''
def __displayGolfSpotAdvice(self, task):
if self.golfSpotAdviceLabel == None:
self.golfSpotAdviceLabel = DirectLabel(text=TTLocalizer.BossbotGolfSpotAdvice, text_fg=VBase4(1, 1, 1, 1), text_align=TextNode.ACenter, relief=None, pos=(0, 0, 0.69), scale=0.1)
return
def __cleanupGolfSpotAdvice(self):
if self.golfSpotAdviceLabel:
self.golfSpotAdviceLabel.destroy()
self.golfSpotAdviceLabel = None
taskMgr.remove(self.golfSpotAdviceName)
return
def showExiting(self):
if self.closeButton:
示例9: PartyCogActivityGui
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
#.........这里部分代码省略.........
self._victoryBalanceBar.setBin('fixed', 0)
self._victoryBalanceBar.setPos(PartyGlobals.CogActivityVictoryBarPos)
self._victoryBalanceBar.setScale(1)
self._victoryBalanceBarOrange = victoryBalanceBar.find('**/*tt_t_gui_pty_pieToss_balanceBarOrange')
self._victoryBalanceBarOrange.reparentTo(self._victoryBalanceBar)
self._victoryBalanceBarOrange.setBin('fixed', 1)
self._victoryBalanceBarOrange.setPos(PartyGlobals.CogActivityVictoryBarOrangePos)
self._victoryBalanceBarOrange.setScale(PartyGlobals.CogActivityBarStartScale, 1.0, 1.0)
self._victoryBalanceBarPie = victoryBalanceBar.find('**/*tt_t_gui_pty_pieToss_balanceBarPie')
self._victoryBalanceBarPie.reparentTo(self._victoryBalanceBar)
self._victoryBalanceBarPie.setBin('fixed', 2)
self._victoryBalanceBarPie.setX(PartyGlobals.CogActivityVictoryBarPiePos[0])
self._victoryBalanceBarPie.setY(PartyGlobals.CogActivityVictoryBarPiePos[1])
self._victoryBalanceBarPie.setZ(PartyGlobals.CogActivityVictoryBarPiePos[2])
self._victoryBalanceBarPie.setScale(PartyGlobals.CogActivityBarPieScale)
self._victoryBalanceBarArrow = victoryBalanceBar.find('**/*tt_t_gui_pty_pieToss_balanceArrow')
self._victoryBalanceBarArrow.reparentTo(self._victoryBalanceBarPie)
self._victoryBalanceBarArrow.setBin('fixed', 2)
self._victoryBalanceBarArrow.setPos(PartyGlobals.CogActivityVictoryBarArrow)
self._victoryBalanceBarArrow.setScale(1 / PartyGlobals.CogActivityBarPieScale)
def _initControlGui(self):
self._attackIvalName = 'PartyCogActivityGui-attackKeys'
self._moveIvalName = 'PartyCogActivityGui-moveKeys'
pieTossControls = loader.loadModel('phase_13/models/parties/tt_m_gui_pty_pieToss_controls')
self._attackKeys = pieTossControls.find('**/*control*')
self._moveKeys = pieTossControls.find('**/*arrow*')
self._moveKeys.reparentTo(aspect2d)
self._moveKeys.setPos(1.0, 0.0, -0.435)
self._moveKeys.setScale(0.15)
self._attackKeys.reparentTo(aspect2d)
self._attackKeys.setPos(0.85, 0.0, -0.45)
self._attackKeys.setScale(0.15)
self._moveKeys.hide()
self._attackKeys.hide()
def _initPiePowerMeter(self):
h = PartyGlobals.CogActivityPowerMeterHeight / 2.0
w = PartyGlobals.CogActivityPowerMeterWidth / 2.0
self._piePowerMeter = DirectWaitBar(frameSize=(-h,
h,
-w,
w), relief=DGG.GROOVE, frameColor=(0.9, 0.9, 0.9, 1.0), borderWidth=(0.01, 0.01), barColor=PartyGlobals.CogActivityColors[0], pos=PartyGlobals.CogActivityPowerMeterPos, hpr=(0.0, 0.0, -90.0))
self._piePowerMeter.setBin('fixed', 0)
self._piePowerTitle = OnscreenText(text=TTLocalizer.PartyCogGuiPowerLabel, pos=PartyGlobals.CogActivityPowerMeterTextPos, scale=0.05, fg=(1.0, 1.0, 1.0, 1.0), align=TextNode.ACenter)
self._piePowerTitle.setBin('fixed', 0)
self._piePowerMeter.hide()
self._piePowerTitle.hide()
def _initScore(self):
self._scoreLabel = OnscreenText(text='0', pos=PartyGlobals.CogActivityScorePos, scale=PartyGlobals.TugOfWarTextWordScale, fg=(1.0, 1.0, 0.0, 1.0), align=TextNode.ARight, font=ToontownGlobals.getSignFont(), mayChange=True)
self._scoreTitle = OnscreenText(text=TTLocalizer.PartyCogGuiScoreLabel, pos=PartyGlobals.CogActivityScoreTitle, scale=0.05, fg=(1.0, 1.0, 1.0, 1.0), align=TextNode.ARight)
self._scoreLabel.hide()
self._scoreTitle.hide()
def _initCogTracker(self):
self._cogTracker = PartyCogTrackerGui()
def _initSpamWarning(self):
self._spamWarning = OnscreenText(text=TTLocalizer.PartyCogGuiSpamWarning, scale=0.15, fg=(1.0, 1.0, 0, 1.0), shadow=(0, 0, 0, 0.62), mayChange=False, pos=(0, 0.33))
self._spamWarning.hide()
def showScore(self):
self._scoreLabel.show()
self._scoreTitle.show()
示例10: DistributedMazeGame
# 需要导入模块: from direct.gui.DirectGui import DirectWaitBar [as 别名]
# 或者: from direct.gui.DirectGui.DirectWaitBar import hide [as 别名]
#.........这里部分代码省略.........
self.notify.debug('load')
DistributedMinigame.load(self)
self.__defineConstants()
mazeName = MazeGameGlobals.getMazeName(self.doId, self.numPlayers, MazeData.mazeNames)
self.maze = Maze.Maze(mazeName)
model = loader.loadModel('phase_3.5/models/props/mickeySZ')
self.treasureModel = model.find('**/mickeySZ')
model.removeNode()
self.treasureModel.setScale(1.6)
self.treasureModel.setP(-90)
self.music = base.loadMusic('phase_4/audio/bgm/MG_toontag.ogg')
self.toonHitTracks = {}
self.scorePanels = []
def unload(self):
self.notify.debug('unload')
DistributedMinigame.unload(self)
del self.toonHitTracks
self.maze.destroy()
del self.maze
self.treasureModel.removeNode()
del self.treasureModel
del self.music
self.removeChildGameFSM(self.gameFSM)
del self.gameFSM
def onstage(self):
self.notify.debug('onstage')
DistributedMinigame.onstage(self)
self.maze.onstage()
self.randomNumGen.shuffle(self.startPosHTable)
lt = base.localAvatar
lt.reparentTo(render)
lt.hideName()
self.__placeToon(self.localAvId)
lt.setAnimState('Happy', 1.0)
lt.setSpeed(0, 0)
self.camParent = render.attachNewNode('mazeGameCamParent')
self.camParent.reparentTo(base.localAvatar)
self.camParent.setPos(0, 0, 0)
self.camParent.setHpr(render, 0, 0, 0)
camera.reparentTo(self.camParent)
camera.setPos(self.camOffset)
self.__spawnCameraTask()
self.toonRNGs = []
for i in xrange(self.numPlayers):
self.toonRNGs.append(RandomNumGen.RandomNumGen(self.randomNumGen))
self.treasures = []
for i in xrange(self.maze.numTreasures):
self.treasures.append(MazeTreasure.MazeTreasure(self.treasureModel, self.maze.treasurePosList[i], i, self.doId))
self.__loadSuits()
for suit in self.suits:
suit.onstage()
self.sndTable = {'hitBySuit': [None] * self.numPlayers,
'falling': [None] * self.numPlayers}
for i in xrange(self.numPlayers):
self.sndTable['hitBySuit'][i] = base.loadSfx('phase_4/audio/sfx/MG_Tag_C.ogg')
self.sndTable['falling'][i] = base.loadSfx('phase_4/audio/sfx/MG_cannon_whizz.ogg')
self.grabSounds = []
for i in xrange(5):
self.grabSounds.append(base.loadSfx('phase_4/audio/sfx/MG_maze_pickup.ogg'))