本文整理汇总了Python中direct.gui.DirectGuiGlobals.getDefaultDialogGeom方法的典型用法代码示例。如果您正苦于以下问题:Python DirectGuiGlobals.getDefaultDialogGeom方法的具体用法?Python DirectGuiGlobals.getDefaultDialogGeom怎么用?Python DirectGuiGlobals.getDefaultDialogGeom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.gui.DirectGuiGlobals
的用法示例。
在下文中一共展示了DirectGuiGlobals.getDefaultDialogGeom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enterReward
# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import getDefaultDialogGeom [as 别名]
def enterReward(self):
numToons = 0
toonLayouts = ((2,), (1, 3), (0, 2, 4), (0, 1, 3, 4))
toonPositions = (5.0, 1.75, -0.25, -1.75, -5.0)
self.toons = []
self.toonsKeep = []
self.counters = []
self.totalCounters = []
camera.reparentTo(render)
base.camLens.setFov(ToontownGlobals.DefaultCameraFov)
camera.setPos(0, 16.0, 2.0)
camera.lookAt(0, 0, 0.75)
base.transitions.irisIn(0.40000000000000002)
self.title.reparentTo(aspect2d)
self.foreground.reparentTo(render)
self.backgroundL.reparentTo(render)
self.backgroundR.reparentTo(render)
self.sidewalk.reparentTo(render)
self.door.reparentTo(render)
size = 20
z = -2.5
floor = CollisionPolygon(Point3(-size, -size, z), Point3(size, -size, z), Point3(size, size, z), Point3(-size, size, z))
floor.setTangible(1)
floorNode = CollisionNode('collision_floor')
floorNode.addSolid(floor)
self.collisionFloor = render.attachNewNode(floorNode)
NametagGlobals.setOnscreenChatForced(1)
for index in range(len(self.ids)):
avId = self.ids[index]
if self.states[index] != PURCHASE_NO_CLIENT_STATE and self.states[index] != PURCHASE_DISCONNECTED_STATE and avId in base.cr.doId2do:
numToons += 1
toon = base.cr.doId2do[avId]
toon.stopSmooth()
self.toons.append(toon)
self.toonsKeep.append(DelayDelete.DelayDelete(toon, 'Purchase.enterReward'))
counter = DirectLabel(parent = hidden, relief = None, pos = (0.0, 0.0, 0.0), text = str(0), text_scale = 0.20000000000000001, text_fg = (0.94999999999999996, 0.94999999999999996, 0, 1), text_pos = (0, -0.10000000000000001, 0), text_font = ToontownGlobals.getSignFont())
counter['image'] = DGG.getDefaultDialogGeom()
counter['image_scale'] = (0.33000000000000002, 1, 0.33000000000000002)
counter.setScale(0.5)
counter.count = 0
counter.max = self.pointsArray[index]
self.counters.append(counter)
money = self.playerMoney[index]
totalCounter = DirectLabel(parent = hidden, relief = None, pos = (0.0, 0.0, 0.0), text = str(money), text_scale = 0.20000000000000001, text_fg = (0.94999999999999996, 0.94999999999999996, 0, 1), text_pos = (0, -0.10000000000000001, 0), text_font = ToontownGlobals.getSignFont(), image = self.jarImage)
totalCounter.setScale(0.5)
totalCounter.count = money
totalCounter.max = toon.getMaxMoney()
self.totalCounters.append(totalCounter)
continue
self.accept('clientCleanup', self._handleClientCleanup)
pos = 0
toonLayout = toonLayouts[numToons - 1]
for toon in self.toons:
thisPos = toonPositions[toonLayout[pos]]
toon.setPos(Vec3(thisPos, 1.0, -2.5))
toon.setHpr(Vec3(0, 0, 0))
toon.setAnimState('neutral', 1)
toon.setShadowHeight(0)
if not toon.isDisabled():
toon.reparentTo(render)
self.counters[pos].setPos(thisPos * -0.17000000000000001, 0, toon.getHeight() / 10 + 0.25)
self.counters[pos].reparentTo(aspect2d)
self.totalCounters[pos].setPos(thisPos * -0.17000000000000001, 0, -0.82499999999999996)
self.totalCounters[pos].reparentTo(aspect2d)
pos += 1
self.maxPoints = max(self.pointsArray)
if self.votesArray:
self.maxVotes = max(self.votesArray)
numToons = len(self.toons)
self.voteMultiplier = TravelGameGlobals.PercentOfVotesConverted[numToons] / 100.0
self.maxBeansFromVotes = int(self.voteMultiplier * self.maxVotes)
else:
self.maxVotes = 0
self.maxBeansFromVotes = 0
def reqCountUp(state):
self.countUp()
return Task.done
countUpDelay = DELAY_BEFORE_COUNT_UP
taskMgr.doMethodLater(countUpDelay, reqCountUp, 'countUpTask')
def reqCountDown(state):
self.countDown()
return Task.done
countDownDelay = countUpDelay + COUNT_UP_DURATION + DELAY_AFTER_COUNT_UP
taskMgr.doMethodLater(countDownDelay, reqCountDown, 'countDownTask')
def celebrate(task):
for counter in task.counters:
counter.hide()
winningPoints = max(task.pointsArray)
for i in range(len(task.ids)):
if task.pointsArray[i] == winningPoints:
avId = task.ids[i]
#.........这里部分代码省略.........
示例2: __init__
# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import getDefaultDialogGeom [as 别名]
def __init__(self, doneEvent):
self.doneEvent = doneEvent
DirectFrame.__init__(self)
self.reparentTo(aspect2d)
self.setPos(0.0, 0.0, 0.16)
self.stash()
publicPartyGui = loader.loadModel('phase_4/models/parties/publicPartyGUI')
self.frame = DirectFrame(parent=self, geom=publicPartyGui.find('**/activities_background'), geom_pos=(-0.8, 0.0, 0.2), geom_scale=2.0, relief=None)
self.earnedLabel = DirectLabel(parent=self, relief=None, text=str(0), text_align=TextNode.ACenter, text_pos=(0.0, -0.07), text_scale=0.2, text_fg=(0.95, 0.95, 0.0, 1.0), text_font=ToontownGlobals.getSignFont(), textMayChange=True, image=DirectGuiGlobals.getDefaultDialogGeom(), image_scale=(0.33, 1.0, 0.33), pos=(-0.3, 0.0, 0.2), scale=0.9)
purchaseModels = loader.loadModel('phase_4/models/gui/purchase_gui')
jarImage = purchaseModels.find('**/Jar')
self.jarLabel = DirectLabel(parent=self, relief=None, text=str(0), text_align=TextNode.ACenter, text_pos=(0.0, -0.07), text_scale=0.2, text_fg=JellybeanRewardGui.JarLabelTextColor, text_font=ToontownGlobals.getSignFont(), textMayChange=True, image=jarImage, scale=0.7, pos=(0.3, 0.0, 0.17))
purchaseModels.removeNode()
del purchaseModels
jarImage.removeNode()
del jarImage
self.messageLabel = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_wordwrap=16.0, text_scale=0.07, pos=(-0.52, 0.0, -0.1), textMayChange=True)
self.doubledJellybeanLabel = DirectLabel(parent=self, relief=None, text=TTLocalizer.PartyRewardDoubledJellybean, text_align=TextNode.ACenter, text_wordwrap=12.0, text_scale=0.09, text_fg=(1.0, 0.125, 0.125, 1.0), pos=(0.0, 0.0, -0.465), textMayChange=False)
self.doubledJellybeanLabel.hide()
self.closeButton = DirectButton(parent=self, relief=None, text=TTLocalizer.PartyJellybeanRewardOK, text_align=TextNode.ACenter, text_scale=0.065, text_pos=(0.0, -0.625), geom=(publicPartyGui.find('**/startButton_up'),
publicPartyGui.find('**/startButton_down'),
publicPartyGui.find('**/startButton_rollover'),
publicPartyGui.find('**/startButton_inactive')), geom_pos=(-0.39, 0.0, 0.125), command=self._close)
publicPartyGui.removeNode()
del publicPartyGui
self.countSound = base.loadSfx('phase_13/audio/sfx/tick_counter_short.mp3')
self.overMaxSound = base.loadSfx('phase_13/audio/sfx/tick_counter_overflow.mp3')
return