Forum Libraries, Components, and Plugins
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

TileMap

I'm having a problems with tilemaps, I'll try and explain the steps I've been through and to date not achieved a solution.

I have created a simple tilemap, this contains a single tileset created from multiple images. Each tile is 128x128(these form the land and platforms). Trying to run results in the tilemap not being displayed, no errors however.
As a test I then used texturepacker to create a single sheet from the individual images, I then used this newly created sheet to create a new tilest based on a tileset image.

Using this method everything worked as expected(no code changes in my app), the tilemap is displayed correctly when I run my application so it appears to me that cocossharp will not work correctly when a tileset is based on multiple individual images?

With the above working I now need to add a 2nd tileset(various objects obstacles and scenery) and as the images are all different sizes I used the 'tileset from multiple images' option within tiled. I place the various tiles from the 2nd tilesheet onto my existing map. Save the map. My app runs but only shows the 1st tilesheet.

I've tried combining my tilesets but no matter what I do cocosharp doesn't seem to want to render any tile that is not on either a) a single tilesheet or b)the standard 128x128 size.

Can anybody point me in the right direction towards a solution.

Posts

  • Victor.ChelaruVictor.Chelaru USMember, Xamarin Team Xamurai

    I can't comment on whether the 2nd tilesheet should or shouldn't work, but you should be able to render tilesheets of any size. For example, CoinTime uses a 2048 x 2048 texture:

    https://developer.xamarin.com/samples/mobile/CoinTime/

    That said, performance degrades significantly when dealing with multiple textures, and keeping everything on one texture is one of the easiest was to keep your game's FPS high. I mention this because it may not be worth trying to get multiple textures working.

Sign In or Register to comment.