Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/api/Points.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2012-06-12 06:16:50 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2012-06-12 06:16:50 (GMT)
commit3ff48820a5873acc6349a0970ea92c8e2639cca9 (patch)
treeba5977d5141064ba73b7c215b6a8da23e5fc8a10 /src/api/Points.py
parent73f29cf533be61f8413a1b5b82585a453f6b5c62 (diff)
add box for points in api
Diffstat (limited to 'src/api/Points.py')
-rw-r--r--src/api/Points.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/api/Points.py b/src/api/Points.py
new file mode 100644
index 0000000..2982f78
--- /dev/null
+++ b/src/api/Points.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+
+import pygame
+from api.Sprite import CSprite
+
+
+class CPoints(CSprite):
+
+ def __init__(self):
+ CSprite.__init__(self)
+ self.mGoods = 0
+ self.mBads = 0
+
+ self.font = pygame.font.Font('assets/fonts/DejaVuSans.ttf', 30)
+ self.fgColor = ((0x00, 0x00, 0x00))
+
+ self.createImage()
+
+ def set_goods(self, aGoods):
+ self.mGoods = aGoods
+ self.createImage()
+
+ def set_bads(self, aBads):
+ self.mBads = aBads
+ self.createImage()
+
+ def createImage(self):
+ self.loadImage('assets/images/points.png')
+
+ fontSurface = self.font.render(str(self.mBads), True, self.fgColor)
+ self.image.blit(fontSurface, (50, 15))
+
+ fontSurface = self.font.render(str(self.mGoods), True, self.fgColor)
+ self.image.blit(fontSurface, (135, 15))
+
+ self.rect = self.image.get_rect()
+ self.setImage(self.image)