Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devtools
diff options
context:
space:
mode:
authordavesilver <nibor123@gmail.com>2010-07-28 17:11:02 (GMT)
committer davesilver <nibor123@gmail.com>2010-07-28 17:11:02 (GMT)
commit9bd5821f6432cebcb598fa88d9030a4b8ed2d2eb (patch)
tree8671f199bcdbfaf7c15de238b4dd22b73e22ca45 /devtools
parentda09d517e8d228cbafefb238d0f7c18d2973b505 (diff)
Testing Drawable Font Objects
Diffstat (limited to 'devtools')
-rw-r--r--devtools/CompleteTestKit/DrawableFontObject.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/devtools/CompleteTestKit/DrawableFontObject.py b/devtools/CompleteTestKit/DrawableFontObject.py
index dbd5d65..19c40fc 100644
--- a/devtools/CompleteTestKit/DrawableFontObject.py
+++ b/devtools/CompleteTestKit/DrawableFontObject.py
@@ -12,3 +12,25 @@ class DrawableFontObject(DrawableObject, pygame.sprite.Sprite):
def changeText(self, newtext):
self._images[0] = font.render(newText, True, (0,0,0))
+
+ def update(self, t): # just updates the frame / object
+
+ print "last update ", self._last_update
+ timePassed = t + self._last_update
+ print "time passed ", timePassed
+ if (timePassed) > self._delay:
+ if self._frame < self.animations.get(self._current_anim)[0] or self._frame > self.animations.get(self._current_anim)[1]:
+ self._frame = self.animations.get(self._current_anim)[0]
+
+ self._frame += timePassed/self._delay
+ print "frame ", self._frame
+
+ while self._frame >= self.animations.get(self._current_anim)[1]:
+ framesPast = self._frame - self.animations.get(self._current_anim)[1]
+ self._frame = framesPast - 1 + self.animations.get(self._current_anim)[0]
+
+ self.image = self._images[self._frame]
+ self._last_update = timePassed%self._delay
+ else:
+
+ self._last_update = timePassed