def blit_a_on_b_aligned(
    surf_a: Surface,
    surf_b: Surface,
    pos_from_b : {
        'widget_name': 'option_menu',
        'widget_kwargs': {
            'options': [
                'topleft', 'topright', 'bottomleft', 'bottomright',
                'midleft', 'midright', 'midtop', 'midbottom',
                'center'
            ]
        },
        'type': str,
    } = 'center',
    pos_to_a : {
        'widget_name': 'option_menu',
        'widget_kwargs': {
            'options': [
                'topleft', 'topright', 'bottomleft', 'bottomright',
                'midleft', 'midright', 'midtop', 'midbottom',
                'center'
            ]
        },
        'type': str,
    } = 'center',
    offset_pos_by: 'python_literal' = (0, 0),
    area=None,
    special_flags=0,
) -> [
    {'name': 'surf_b', 'type': Surface},
    {'name': 'affected_rect', 'type': Rect},
]:
    """Draw surface a onto b and return affected area and surface b."""
    rect_a, rect_b = surf_a.get_rect(), surf_b.get_rect()

    pos = getattr(rect_b.move(offset_pos_by), pos_from_b)
    setattr(rect_a, pos_to_a, pos)

    affected_rect = surf_b.blit(surf_a, rect_a, area, special_flags)

    return {
        'surf_b': surf_b,
        'affected_rect': affected_rect,
    }
Draw surface a onto b and return affected area and surface b.
nodezator/graphman/capsulenode/pygamedefs.py