Mercurial > touhou
comparison pytouhou/game/text.py @ 433:1222341ea22c
Always run the first frame of an ANMRunner.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 11 Aug 2013 14:23:50 +0200 |
parents | c9433188ffdb |
children | 723a3e67a223 |
comparison
equal
deleted
inserted
replaced
432:d4874ebaa06e | 433:1222341ea22c |
---|---|
38 # Set up the backround sprite | 38 # Set up the backround sprite |
39 self.back_anm = back_anm | 39 self.back_anm = back_anm |
40 if back_anm: | 40 if back_anm: |
41 self.sprite = Sprite() | 41 self.sprite = Sprite() |
42 self.anmrunner = ANMRunner(back_anm, back_script, self.sprite) | 42 self.anmrunner = ANMRunner(back_anm, back_script, self.sprite) |
43 self.anmrunner.run_frame() | |
44 | 43 |
45 self.x, self.y = pos | 44 self.x, self.y = pos |
46 | 45 |
47 def update(self): | 46 def update(self): |
48 self.frame += 1 | 47 self.frame += 1 |
62 self.anm = anm | 61 self.anm = anm |
63 self.glyphes = [] | 62 self.glyphes = [] |
64 self.xspacing = xspacing | 63 self.xspacing = xspacing |
65 | 64 |
66 # Set up ref sprite | 65 # Set up ref sprite |
67 anm_runner = ANMRunner(anm, ref_script, self.ref_sprite) | 66 ANMRunner(anm, ref_script, self.ref_sprite) |
68 anm_runner.run_frame() | |
69 self.ref_sprite.corner_relative_placement = True #TODO: perhaps not right | 67 self.ref_sprite.corner_relative_placement = True #TODO: perhaps not right |
70 | 68 |
71 | 69 |
72 def set_length(self, length): | 70 def set_length(self, length): |
73 current_length = len(self.glyphes) | 71 current_length = len(self.glyphes) |
223 | 221 |
224 class Gauge(object): | 222 class Gauge(object): |
225 def __init__(self, pos, anm, max_length=280, maximum=1, value=0): | 223 def __init__(self, pos, anm, max_length=280, maximum=1, value=0): |
226 self.sprite = Sprite() | 224 self.sprite = Sprite() |
227 self.anmrunner = ANMRunner(anm, 21, self.sprite) | 225 self.anmrunner = ANMRunner(anm, 21, self.sprite) |
228 self.anmrunner.run_frame() | |
229 self.removed = False | 226 self.removed = False |
230 self.sprite.corner_relative_placement = True #TODO: perhaps not right | 227 self.sprite.corner_relative_placement = True #TODO: perhaps not right |
231 self.objects = [self] | 228 self.objects = [self] |
232 | 229 |
233 self.x, self.y = pos | 230 self.x, self.y = pos |