示例#1
0
def loadMapFile(path, engine, data, callback=None):
    """     load map file and get (an optional) callback if major stuff is done:
    - map creation
    - parsed impor0ts
    - parsed layers 
    - parsed cameras
    the callback will send both a string and a float (which shows
    the overall process), callback(string, float)
    
    Inputs:
        path = filename for map
        engine = FIFE engine
        data = Engine object for PARPG data
        
    @return    map    : map object
    """
    map_loader = XMLMapLoader(engine, data, callback)
    map = map_loader.loadResource(fife.ResourceLocation(path))
    print "--- Loading map took: ", map_loader.time_to_load, " seconds."
    return map
示例#2
0
文件: loaders.py 项目: m64/PEG
def loadMapFile(path, engine, callback=None):
    global data
    data = AttributeInterceptor()
    map_loader = XMLMapLoader(engine, data, callback)
    map = map_loader.loadResource(fife.ResourceLocation(path))
    return map