diff pytouhou/game/text.py @ 347:b150ed7188a2

Show the size of the spellcard life.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 05 Jul 2012 00:53:16 +0200
parents 862011266f2c
children f1649d6c6397
line wrap: on
line diff
--- a/pytouhou/game/text.py
+++ b/pytouhou/game/text.py
@@ -151,7 +151,7 @@ class Counter(GlyphCollection):
 
 
 class Gauge(object):
-    def __init__(self, pos, anm_wrapper, max_length=280, maximum=1, value=0.):
+    def __init__(self, pos, anm_wrapper, max_length=280, maximum=1, value=0):
         self.sprite = Sprite()
         self.anmrunner = ANMRunner(anm_wrapper, 21, self.sprite)
         self.anmrunner.run_frame()
@@ -172,6 +172,11 @@ class Gauge(object):
 
 
     def update(self):
+        #XXX
+        if self.value == 0:
+            self.sprite.visible = False
+        else:
+            self.sprite.visible = True
         if self.anmrunner and not self.anmrunner.run_frame():
             self.anmrunner = None