Example #1
0
def vcenter_blit(target, source, dest = (0, 0), area=None, special_flags=0):
    '''
    The same as center_blit(), but only centers vertically.
    '''
    loc = lambda d, s: (_vec(0, d.get_height() / 2) - 
            _vec(0, s.get_height() / 2))
    _blitter(loc, target, source, dest, area, special_flags)
Example #2
0
def hcenter_blit(target, source, dest = (0, 0), area=None, special_flags=0):
    '''
    The same as center_blit(), but only centers horizontally.
    '''
    loc = lambda d, s: (_vec(d.get_width() / 2, 0) - 
            _vec(s.get_width() / 2, 0))
    _blitter(loc, target, source, dest, area, special_flags)
Example #3
0
def center_blit(target, source, dest = (0, 0), area=None, special_flags=0):
    '''
    Blits surface @source to the center of surface @target. Takes the normal 
    Surface.blit() flags; however, @dest is used as an offset.
    '''
    loc = lambda d, s: _vec(d.get_size()) / 2 - _vec(s.get_size()) / 2
    _blitter(loc, target, source, dest, area, special_flags)