xamarincocossharp

Load issue with .tmx file


I've got an issue when I try to load a .tmx file in a CCTileMap CocosSharp object.

Here is the code :

                layer2 = new CCLayer();
                CCTileMap tileMap;
                tileMap = new CCTileMap("TestCCS.Droid.Assets/TileMaps/TestTile2.tmx");

                layer2.AddChild(tileMap);
                this.AddChild(layer2);

I tried :

                tileMap = new CCTileMap("TestCCS.Droid.Assets.TileMaps.TestTile2.tmx");

or :

                tileMap = new CCTileMap("Assets.TileMaps.TestTile2.tmx");

The TestTile2.tmx file build Action is set to "Embedded resource"

And this my solution explorer :

enter image description here

Thank you for your help.


Solution

  • Found a way to load the TileMap file.

    The solution I found :

    Where "TestTile2.xml" is an android asset.

    Hope this will help others !