Example #1
0
def getCards(f, configname = 'card3d.cfg'):
    config = ConfigParser()
    config.read(configname)
    config.card3dname = configname
    cards = {}
    dct = Dict(
            velocity=vector(0,-1,0),
            color=(1,1,1), background=(0.25,0.25,0.25), opacity=0.2,
            keep=1.0, frame=f,
            visible=True)
    for num, (key, val) in enumerate(config._sections.iteritems()):
        if not key.startswith('card'):
            continue
        dig = key[4:]
        if not dig.isdigit():
            continue
        dig = int(dig)
        line = val['text']
        (dct.pos, dct.card, dct.text) = ((num % 4, 4, num % 4), dig, line)
        dct.radius = 1
        cards[key] = Card(dct)
    return (config, cards)