From c95964c8f7a0e61f258b36cff6fdcb69706b05d5 Mon Sep 17 00:00:00 2001 From: Alan Aguiar Date: Mon, 18 Jun 2012 05:28:36 +0000 Subject: minor comment in MultiLabel --- diff --git a/src/api/MultiLabel.py b/src/api/MultiLabel.py index e6af4b6..fdaaa3e 100755 --- a/src/api/MultiLabel.py +++ b/src/api/MultiLabel.py @@ -4,7 +4,7 @@ from Sprite import CSprite import pygame class CMultiLabel(CSprite): - """ accepts a list of strings, creates a multi-line + """ accepts a string separate with \n, creates a multi-line label to display text same properties as label except textLines is a list of strings. There is no text @@ -17,10 +17,7 @@ class CMultiLabel(CSprite): CSprite.__init__(self) self.text = 'This\nis\nsample\ntext' #self.font = pygame.font.Font("freesansbold.ttf", 20) - #TODO: Esto no debe ir aca. Porque este no anda y el de CSuperSprite si ? - #pygame.font.init() - #print "CMultilabel" - #print pygame.font.get_init() + self.font = pygame.font.Font('assets/fonts/DejaVuSans.ttf', 20) self.fgColor = ((0x00, 0x00, 0x00)) self.bgColor = ((0xFF, 0xFF, 0xFF)) @@ -43,6 +40,7 @@ class CMultiLabel(CSprite): def createImage(self): self.image = pygame.Surface(self.size) self.image.fill(self.bgColor) + self.textLines = self.text.split('\n') numLines = len(self.textLines) vSize = self.image.get_height() / numLines -- cgit v0.9.1