Custom Format Plugin

Mar 22, 2016 at 7:48 PM
I'm trying to make a plugin for loading in maps with a custom format. However, it seems that the plugin architecture doesn't expose any of the more useful members such as the map panel and tree view, etc. What's the best option here? I could use reflection to pull those out, since they seem to be in there, just not exposed.
Mar 23, 2016 at 3:00 PM

Hi, if you can wait I will look into it end of next week as I am abroad.

Mar 23, 2016 at 4:57 PM
Sure, I can wait. Or, I can make some changes and let you know what I changed.
Mar 23, 2016 at 8:27 PM
From a quick look at the sources, you just need to implement your new format by implementing interface xtile.format.IMapFormat and register it via static class FormatManager. You can do this within your new plugin or in host code that is using the xtile API.

You shouldn't need to access MapPanel code for this.
Marked as answer by merthsoft on 3/23/2016 at 1:55 PM
Mar 23, 2016 at 9:01 PM
Oooh okay, I get it. Thanks! I was thinking it would be something in Plugin.
Mar 23, 2016 at 9:54 PM
Edited Mar 23, 2016 at 9:55 PM
Okay, so what I do need access to then is the base path when loading, since I need to unarchive the images relative to that path.

Nevermind, I can get that with Directory.GetCurrentDirectory();
Mar 24, 2016 at 6:35 AM
If you browse the sources you can have a look at some format implementations (xTile XML and binary in the xtile API and Tiled, Nappy and Flixel in the tIDE codebase).

Hope that helps.