gui: Fix aspect2d positioning for GUI elements in the maze minigame.

This commit is contained in:
Sam Edwards 2013-10-25 11:09:50 -06:00
parent 7d0150b4bb
commit 8bb9f5c6f7
2 changed files with 9 additions and 4 deletions

View file

@ -35,13 +35,16 @@ class OTPTimer(DirectFrame):
return OTPTimer.ClockImage
def posInTopRightCorner(self):
self.setPos(1.16, 0, 0.83)
self.reparentTo(base.a2dTopRight)
self.setPos(-0.173, 0, -0.17)
def posBelowTopRightCorner(self):
self.setPos(1.16, 0, 0.58)
self.reparentTo(base.a2dTopRight)
self.setPos(-0.173, 0, -0.42)
def posAboveShtikerBook(self):
self.setPos(1.16, 0, -.63)
self.reparentTo(base.a2dBottomRight)
self.setPos(-0.173, 0, 0.37)
def setTime(self, time):
time = bound(time, 0, 999)

View file

@ -694,7 +694,8 @@ class DistributedMazeGame(DistributedMinigame):
avId = self.avIdList[i]
avName = self.getAvatarName(avId)
scorePanel = MinigameAvatarScorePanel.MinigameAvatarScorePanel(avId, avName)
scorePanel.setPos(1.12, 0.0, 0.5 - 0.28 * i)
scorePanel.reparentTo(base.a2dTopRight)
scorePanel.setPos(-0.213, 0.0, -0.5 - 0.28 * i)
self.scorePanels.append(scorePanel)
self.goalBar.show()
@ -1087,6 +1088,7 @@ class DistributedMazeGame(DistributedMinigame):
for i in xrange(self.numPlayers):
panel = self.scorePanels[i]
pos = scorePanelLocs[i]
panel.wrtReparentTo(aspect2d)
lerpTrack.append(Parallel(LerpPosInterval(panel, lerpDur, Point3(pos[0], 0, pos[1]), blendType='easeInOut'), LerpScaleInterval(panel, lerpDur, Vec3(panel.getScale()) * 2.0, blendType='easeInOut')))
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))