XTiled in MonoGame - import TMX maps in MonoGame -
i have created tmx map in tiled map editor , use xtiled load map in monogame. in xna project maps loads perfeclty, in monogame can't. build .tmx file xna project(in content project) build in monogame project .xnb file references set. build succeeds map can't load.
i appreciate if tell me steps load tmx map in monogame or provide me tutorials this.
thanks in advance.
in case, can assure it's possible load tiled maps using xtile in monogame. did 1 of our games called rock run.
the trick recompile xtile monogame dependencies. here's snippet of our level loading code might help:
string levelpath = string.format (@"content\level{0:00}.tbin", level); var stream = titlecontainer.openstream(levelpath); _map = xtile.format.formatmanager.instance.binaryformat.load(stream); _mapdisplaydevice = new xnadisplaydevice(content, graphicsdevice, screenscale); _map.loadtilesheets(_mapdisplaydevice); var viewportsize = new xtile.dimensions.size(screenwidth, screenheight); _viewportrectangle = new xtile.dimensions.rectangle(viewportsize); there's few things note here. didn't bother pre-compiling content xnb files first. exported map editor binary (tbin) files , added direct content. although, don't think that's problem, , memory had make minor changes work way. using xnb files should work well.
secondly, use titlecontainer read file stream, because on android devices files stored in isolated storage , can't find them typical file system operations.
everything else should pretty self explanatory if you've followed the tutorial.
Comments
Post a Comment