Hello Guest

Author Topic: Problems rotating tiles with Tiled and loading them in a 2dtk Tilemap  (Read 3916 times)

tzamora

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Hi, I've been working on a game where I want to use Tiled with 2d Toolkit. But I'm having some problems.

This is what I'm doing.
1. I create a simple map in Tiled (using the desert example) and I draw a map of 2x2 tiles.
2. I draw a "square" using only one tile, rotating each tile using the z key to rotate it.
3. I create a new project in Unity with 2DToolkit.
4. I create a SpriteCollection and create a spritesheet using the desert image that comes as an example.
5. I create a new tileMap in the scene. This step gives me an error, saying the following:

NullReferenceException: Object reference not set to an instance of an object
tk2dTileMap.Awake () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:107)
UnityEngine.GameObject:AddComponent()
tk2dTileMapEditor:Create() (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:1267)

6. I omit the error and continue importing the .tmx file

Finally what happens is that the tiles aren't rotated. They appear as if they weren't rotated by the z key command in Tiled.

They should appear like this:

https://www.dropbox.com/s/mjzy9u3zytfvmgk/Screenshot%202013-11-26%2021.18.31.png

Some hints to see if I could check the code to fix this? Thanks :) I will share a link where you could find the project with all the assets if you would like to repeat the process:

Edit: Removed link  - please only post links to projects in the private support forum
« Last Edit: November 27, 2013, 01:03:19 pm by unikronsoftware »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems rotating tiles with Tiled and loading them in a 2dtk Tilemap
« Reply #1 on: November 27, 2013, 01:12:23 pm »
Thanks for the comprehensive test case, it always makes it considerably easier to find an issue when its reported like this. Turns out the importer was never updated to support flip / rotate when we implemented it in our system. It'll be fixed in the next release, but if you want it sooner, email support and I'll send you a patch.

tzamora

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Problems rotating tiles with Tiled and loading them in a 2dtk Tilemap
« Reply #2 on: November 27, 2013, 04:01:30 pm »
Thanks!
Sorry to ask but how do I email support? Just post a message in the private support forum?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems rotating tiles with Tiled and loading them in a 2dtk Tilemap
« Reply #3 on: November 27, 2013, 04:28:19 pm »
support at unikronsoftware dot com