Esempio n. 1
0
    def _makeKeyboards(self, finishedCB, parent):
        
        self._namesToEnter = len(self._players)
        playerScores = []
        for player in self._players:
            playerScores.append(player.score)
        
        for player in self._players:
 
            
            heading = avg.WordsNode( color="FFFFFF",
                                      fontsize=25,
                                      sensitive=False,
                                      angle=player.angle,
                                      alignment="center",
                                     )
            
            hsen = HighscoreEntryNode(self._highscore, player.score, playerScores, finishedCB, parent=parent, size=(util.WINDOW_SIZE[0]//3,util.WINDOW_SIZE[0]//9))
            hsen.angle = player.angle
            
            hsen.appendChild(heading)
 
            if player in self.remainaingPlayers:
                designation = "WINNER"
            else:
                designation = "LOSER"
            heading.text=  "{}<br/>{} Points".format(designation, player.score)
           
            util.centerNodeOnPosition(hsen, player.pos)
            util.centerNodeOnPosition(heading, util.vectorAdd((0,0), (hsen.size[0]/2, -heading.getMediaSize()[1])))
Esempio n. 2
0
 def _makeKeyboards(self, finishedCB, parent):
     self._namesToEnter = len(self._players)
     playerScores = []
     for player in self._players:
         playerScores.append(player.score)
     
     for player in self._players:
             
         hsen = HighscoreEntryNode(self._highscore, player.score, playerScores, finishedCB, parent=parent, size=(util.WINDOW_SIZE[0]//3,util.WINDOW_SIZE[0]//9))
         if player.angle < util.degToRad(45) or player.angle > util.degToRad(225):
             playerPos = player.pos[0], player.pos[1]- 165
         else:
             playerPos = player.pos[0], player.pos[1] + 15
         if player.angle < util.degToRad(135):
             playerPos = playerPos[0]-125, playerPos[1]
         else:
             playerPos = playerPos[0]-325, playerPos[1]
         hsen.angle = player.angle + math.pi/4
         hsen.pos=playerPos[0], playerPos[1]