Ejemplo n.º 1
0
	def draw(self, backColor):
		pygame.draw.rect(DISPLAYSURF, backColor, self.rect)
		(left, top, width, height) = self.rect	
		text = Button.FONT.render(self.name, True, Button.FONT_COLOR, backColor)
		rect = text.get_rect()
		rect.center = (left+width/2, top+height/2)
		DISPLAYSURF.blit(text, rect)
Ejemplo n.º 2
0
 def draw(self):
     i = 0
     for line in self.text:
         left = self.pos[0]
         top = self.pos[1] + TextBox.MARGIN * i
         text = TextBox.FONT.render(line, True, self.color, self.backColor)
         rect = text.get_rect()
         if self.horzCentered:
             rect.centerx = left
         else:
             rect.left = left
         rect.top = top
         if rect.width > self.width:
             self.width = rect.width
         DISPLAYSURF.blit(text, rect)
         i += 1
Ejemplo n.º 3
0
	def draw(self):	
		i = 0
		for	line in self.text:
			left = self.pos[0]
			top = self.pos[1] + TextBox.MARGIN * i
			text = TextBox.FONT.render(line, True, self.color, self.backColor)
			rect = text.get_rect()
			if self.horzCentered:
				rect.centerx = left
			else:
				rect.left = left
			rect.top = top
			if rect.width > self.width:
				self.width = rect.width
			DISPLAYSURF.blit(text, rect)		
			i+=1