Dusk tile rotation does not seem to correspond to the Tiled rotation

Sorry about a stupid question. This is my first Tiled -> Dusk attempt  :slight_smile:

I’ve exported a json tile file from Tiled and used it in a super simple Dusk example, just to see if I got anything on screen:

display.setStatusBar(display.HiddenStatusBar) display.setDefault("minTextureFilter", "nearest") display.setDefault("magTextureFilter", "nearest") local dusk = require("Dusk.Dusk") dusk.setPreference("enableRotatedMapCulling", true) local currMap = "L6.json" local map = dusk.buildMap("maps/" .. currMap) map.setTrackingLevel(0.3) -- "Fluidity" of the camera movement; numbers closer to 0 mean more fluidly and slowly (but 0 itself will disable the camera!) Runtime:addEventListener("enterFrame", map.updateView)

But the rotation of the tiles using Dusk does not seem to be the same as the rotation of the tile as I made the map in Tiled.

Here’s how the code above looks in the simulator (top) and how it looks in the Tiled editor:

Seems like there 90 and 270 rotation gets swapped somehow. I haven’t yet tried out how mirrored tiles translated from Tiled to Dusk.

I’m sure I’m doing something horribly wrong, but I cannot figure it out.

The json file and tile set png file is attached as “maps.zip”. Thanks!

Hmmm… not much of a response there… maybe the example was too complicated.

Here’s the most minimalistic example I can create that shows my problem:

The map looks like this in Tiled (left) and in the Corona Simulator (right):

The code looks like this

local dusk = require("Dusk.Dusk") local map = dusk.buildMap("L1.json") map.width = display.contentWidth map.height = display.contentHeight

The L1.json and the tileset (consisting of 1 tile) tile_set.png are attached (in the zip file).

Can anybody please check to see if they get the same problem?

Thanks!

Dusk does not currently support tile rotation. It does support flipping, however. I’ll add tile rotation to my list for 1.0.

And sorry for the late reply, I’ve really been swamped lately so the extent of my forum and email responses has been a quick reply to one or two topics every now and then.

  • Caleb

Thank you for replying, Caleb!

This certainly explains a thing or two…  :)  I didn’t imagine that explanation.

So those who uses Tiled/Dusk today have to make two versions of each tile (one that is rotated 90 degrees to cover all 8 variants? Is that how it’s done?

Unfortunately yes :(.

  • Caleb

OK, thanks. At least now I know how it works and can start playing with Dusk for real.

Looking forward to 1.0 then! Keep up the good work  :slight_smile:

Hmmm… not much of a response there… maybe the example was too complicated.

Here’s the most minimalistic example I can create that shows my problem:

The map looks like this in Tiled (left) and in the Corona Simulator (right):

The code looks like this

local dusk = require("Dusk.Dusk") local map = dusk.buildMap("L1.json") map.width = display.contentWidth map.height = display.contentHeight

The L1.json and the tileset (consisting of 1 tile) tile_set.png are attached (in the zip file).

Can anybody please check to see if they get the same problem?

Thanks!

Dusk does not currently support tile rotation. It does support flipping, however. I’ll add tile rotation to my list for 1.0.

And sorry for the late reply, I’ve really been swamped lately so the extent of my forum and email responses has been a quick reply to one or two topics every now and then.

  • Caleb

Thank you for replying, Caleb!

This certainly explains a thing or two…  :)  I didn’t imagine that explanation.

So those who uses Tiled/Dusk today have to make two versions of each tile (one that is rotated 90 degrees to cover all 8 variants? Is that how it’s done?

Unfortunately yes :(.

  • Caleb

OK, thanks. At least now I know how it works and can start playing with Dusk for real.

Looking forward to 1.0 then! Keep up the good work  :slight_smile: