Пример #1
0
	def drawScoreBoard(self, scores, totalScore, lvlTime, trophy, refTime):
		""" Prints data on score board """
		scr = self.screens['SCOREBOARD']

		# Background
		scr.drawBG()

		posX = MENU_SPACE_M*3
		posY = MENU_SPACE_M*6

		### SCORE ###
		for s in scores:
			# Player score
			scr.drawText(text=Score.formatScore(s), color=SCORE_LBL_COLOR, size=BONUS_SZ, posX=posX, posY=posY, bold=1, alignH=TEXT_ALIGN['H']['RIGHT'])
			# Score level label
			posY = scr.drawText(text=s.label, color=SCORE_LBL_COLOR, size=BONUS_SZ, posX=posX, posY=posY, bold=1)
			posY += MENU_SPACE_S
		# Player total score
		scr.drawText(text=str(totalScore), color=SCORE_LBL_COLOR, size=SCORE_SZ, posX=posX, posY=posY, bold=1, alignH=TEXT_ALIGN['H']['RIGHT'])
		# Total score label 
		posY = scr.drawText(text=SCORE_TOTAL_LBL, color=SCORE_LBL_COLOR, size=SCORE_SZ, posX=posX, posY=posY, bold=1)
		
		### TIME ###
		# Player time
		posY += MENU_SPACE_M
		scr.drawText(text=lvlTime.formatCounter(), color=SCORE_LBL_COLOR, size=TIME_SZ, posX=posX, posY=posY, bold=1, alignH=TEXT_ALIGN['H']['RIGHT'])
		# Time label
		posY = scr.drawText(text=MENU_TIME_LBL, color=SCORE_LBL_COLOR, size=TIME_SZ, posX=posX, posY=posY, bold=1)
		
		### TROPHY ###
		# Player trophy
		posY = scr.height/2 + MENU_SPACE_M
		if trophy is not None:
			posY = scr.drawText(text=trophy, color=SCORE_LBL_COLOR, size=RESUME_LBL_SZ, posX=0, posY=posY, bold=1, alignH=TEXT_ALIGN['H']['CENTER'])
		else:
			posY = scr.drawText(text=NO_TROPHY_LBL, color=SCORE_LBL_COLOR, size=RESUME_LBL_SZ, posX=0, posY=posY, bold=1, alignH=TEXT_ALIGN['H']['CENTER'])

		# Level time reference
		posY += MENU_SPACE_M
		if refTime:
			for tro, time in refTime.iteritems():
				color = TROPHY_PLAYER_COLOR if tro == trophy else SCORE_LBL_COLOR
				# Reference time 
				scr.drawText(text=Counter.formatTime(time*1000), color=color, size=TROPHY_REF_SZ, posX=posX, posY=posY, bold=1, alignH=TEXT_ALIGN['H']['RIGHT'])
				# Trophy label
				posY = scr.drawText(text=tro, color=color, size=TROPHY_REF_SZ, posX=posX, posY=posY, bold=1)
				posY += MENU_SPACE_S