diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2012-06-18 05:28:36 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2012-06-18 05:28:36 (GMT) |
commit | c95964c8f7a0e61f258b36cff6fdcb69706b05d5 (patch) | |
tree | 3c9edda8b2d3101104b940bc303e6cebe5c0c52a | |
parent | 5ee4402bcfee08d70a4e0295847a87da23ce95e6 (diff) |
minor comment in MultiLabel
-rwxr-xr-x | src/api/MultiLabel.py | 8 |
1 files changed, 3 insertions, 5 deletions
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
|