예제 #1
0
파일: transition.py 프로젝트: jduda/freevo1
    def __init__(self, surf1, surf2, mode=-1, direction="vertical", fps=25, speed=1):
        """
        Initialise an instance of the Transition class
        @ivar surf1: Surface to blend with
        @ivar surf2: New surface
        @ivar mode: effect to use
        @ivar direction: vertical/horizontal
        """
        BaseAnimation.__init__(self, surf1.get_rect(), fps, bg_update=False)
        logger.log(9, "__init__(surf1=%r, surf2=%r, mode=%r, direction=%r, fps=%r)", surf1, surf2, mode, direction, fps)

        self.steps = fps
        self.mode = mode
        self.direction = direction

        self.speed = speed

        # WARNING: self.drawfuncs should not contain links to it's member
        # functions because this results in circular dependencies and the
        # Python garbage collector won't work
        self.drawfuncs = {0: "draw_blend_alpha", 1: "draw_wipe", 2: "draw_wipe_alpha"}

        self.surf_blend1 = surf1.convert()
        self.surf_blend2 = surf2.convert()
        self.inprogress = kaa.InProgress()
        self.prepare()
예제 #2
0
    def __init__(self, surf1, surf2, mode=-1, direction='vertical', fps=25):
        """
        @surf1: Surface to blend with
        @surf2: New surface
        @mode: effect to use
        @direction: vertical/horizontal
        """
        BaseAnimation.__init__(self, surf1.get_rect(), fps, bg_update=False)

        self.steps = fps
        self.mode = mode
        self.direction = direction

        # WARNING: self.drawfuncs should not contain links to it's member
        # functions because this results in circular dependencies and the
        # Python garbage collector won't work
        self.drawfuncs = {
            0: 'draw_blend_alpha',
            1: 'draw_wipe',
            2: 'draw_wipe_alpha'
        }

        self.surf_blend1 = surf1.convert()
        self.surf_blend2 = surf2.convert()

        self.prepare()
예제 #3
0
    def __init__(self, rectstyle, surface, step_x=1, fps=25, init_sleep=-1,
                 bg_update=True, bg_wait=False, bg_redraw=False):

        BaseAnimation.__init__(self, rectstyle, fps, bg_update, bg_wait, bg_redraw)

        self.image  = surface
        self.step_x = step_x

        self.w, self.h = surface.get_size()
        self.animrect  = Rect( (0, 0, self.rect.width, self.rect.height) )
예제 #4
0
파일: marquee.py 프로젝트: freevo/freevo1
    def __init__(
        self, rectstyle, surface, step_x=1, fps=25, init_sleep=-1, bg_update=True, bg_wait=False, bg_redraw=False
    ):

        BaseAnimation.__init__(self, rectstyle, fps, bg_update, bg_wait, bg_redraw)

        self.image = surface
        self.step_x = step_x

        self.w, self.h = surface.get_size()
        self.animrect = Rect((0, 0, self.rect.width, self.rect.height))
예제 #5
0
    def __init__(self,
                 surf1,
                 surf2,
                 mode=-1,
                 direction='vertical',
                 fps=25,
                 speed=1):
        """
        Initialise an instance of the Transition class
        @ivar surf1: Surface to blend with
        @ivar surf2: New surface
        @ivar mode: effect to use
        @ivar direction: vertical/horizontal
        """
        BaseAnimation.__init__(self, surf1.get_rect(), fps, bg_update=False)
        logger.log(
            9, '__init__(surf1=%r, surf2=%r, mode=%r, direction=%r, fps=%r)',
            surf1, surf2, mode, direction, fps)

        self.steps = fps
        self.mode = mode
        self.direction = direction

        self.speed = speed

        # WARNING: self.drawfuncs should not contain links to it's member
        # functions because this results in circular dependencies and the
        # Python garbage collector won't work
        self.drawfuncs = {
            0: 'draw_blend_alpha',
            1: 'draw_wipe',
            2: 'draw_wipe_alpha'
        }

        self.surf_blend1 = surf1.convert()
        self.surf_blend2 = surf2.convert()
        self.inprogress = kaa.InProgress()
        self.prepare()