Exemplo n.º 1
0
Arquivo: terrain.py Projeto: jjtj/l2
def createFromObject(svgfn, objinfo, worldsize, outfolder):
    outname = objinfo['id']

    sx = objinfo['x']
    sy = objinfo['y']
    w = objinfo['w']
    h = objinfo['h']

    fn = inkscape.exportObject(svgfn, objinfo['id'], outfolder)
    json = createTerrain(fn, sx, sy, w, h, outfolder, outname)
    return dict(fn=fn, json=json)
Exemplo n.º 2
0
Arquivo: level-gen.py Projeto: jjtj/l2
def generateLevelCheckPoint(svgfn,
                            root,
                            lvl,
                            worldSize,
                            outfolder):
    chkpts = lvl['checkPoints']
    for c in chkpts:
        cid = c['id']
        el = findElementById(root, cid)

        if el == None:
            continue

        isLine = el.get('isLine', '0')
        c['isLine'] = (isLine == '1')

        if c['isLine']:
            # We just need a png file
            fn = inkscape.exportObject(svgfn, cid, outfolder)
            c['imgfile'] = fn
        else:
            terrainResult = terrain.createFromObject(svgfn, c, worldSize, outfolder)
            c['imgfile'] = terrainResult['fn']
            c['terrainjson'] = terrainResult['json']
Exemplo n.º 3
0
Arquivo: level-gen.py Projeto: jjtj/l2
def generateLevelTitle(svgfn, root, lvl, outfolder):
    t = lvl['title']
    tid = t['id']

    fn = inkscape.exportObject(svgfn, tid, outfolder)
    t['imgfile'] = fn