コード例 #1
0
 def do_fatetell_anim(self):
     self.ft_anim = True
     self.question_scale = ChainInterp(
         SineInterp(0.0, 1.0, 0.1),
         CosineInterp(1.0, 0.0, 0.1),
         FixedInterp(0.0, 0.2),
         SineInterp(0.0, 1.0, 0.1),
         CosineInterp(1.0, 0.0, 0.1),
         FixedInterp(0.0, 0.2),
         SineInterp(0.0, 1.0, 0.1)
     )
     self.back_scale = ChainInterp(
         FixedInterp(0.0, 0.2),
         SineInterp(0.0, 1.0, 0.1),
         CosineInterp(1.0, 0.0, 0.1),
         FixedInterp(0.0, 0.2),
         SineInterp(0.0, 1.0, 0.1),
         CosineInterp(1.0, 0.0, 0.1),
     )
     self.ftanim_alpha = ChainInterp(
         FixedInterp(1.0, 1.0),
         LinearInterp(1.0, 0.0, 2.0),
         on_done=self._end_ft_anim,
     )
     self.ftanim_cardalpha = ChainInterp(
         FixedInterp(0.0, 1.0),
         FixedInterp(1.0, 0.0),
     )
コード例 #2
0
 def fade(self):
     for cs in self.control_list:
         cs.alpha = ChainInterp(
             FixedInterp(1.0, 0.45),
             CosineInterp(1.0, 0.0, 0.3),
             on_done=self._on_cardanimdone,
         )
コード例 #3
0
ファイル: game_controls.py プロジェクト: yuzishui/thbattle
 def __init__(self, x0, y0, x1, y1, *args, **kwargs):
     Control.__init__(self, *args, **kwargs)
     from math import sqrt, atan2, pi
     self.x, self.y = x0, y0
     dx, dy = x1 - x0, y1 - y0
     scale = sqrt(dx * dx + dy * dy) / L('c-ray').width
     self.angle = atan2(dy, dx) / pi * 180
     self.scale = SineInterp(0.0, scale, 0.4)
     self.alpha = ChainInterp(FixedInterp(1.0, 1),
                              CosineInterp(1.0, 0.0, 0.5),
                              on_done=lambda self, desc: self.delete())
コード例 #4
0
    def fade(self):
        for cs in self.control_list:
            try:
                cs.dca_tag
                continue
            except AttributeError:
                cs.dca_tag = 1

            cs.alpha = ChainInterp(
                FixedInterp(1.0, 3),
                CosineInterp(1.0, 0.0, 1),
                on_done=self._on_cardanimdone,
            )
コード例 #5
0
 def set_flash(self, duration):
     self.flash_alpha = CosineInterp(1.0, 0.0, duration)