*takes a deep breath*
I’m not exactly sure what you took offence to; hopefully this post better explains what I was talking about. I’ll admit one of your comments ticked me off pretty well as well, but I’ll just assume it’s another misunderstanding and get to the explanation:
-
“border” did not exist in the API doc as of my original post last week. (“EDIT: Oh, it’s not”) was not a smarmy reply, it was a matter or fact reply after I spent some time searching through coronalabs.com to see if I was mistaken. Clearly it’s fixed now, so we’re all the better for it, the end.
-
I simply suggested a guide/tutorial similar to the excellent one already there for masks, since both have similar, non-intuitive solutions. It doesn’t sound like Corona Labs is particularly interested in blog volunteers but I’d write it myself if asked.
-
Explaining the power of 2 guess; clearly I was reaching for words to describe what was happening, but now I have a better idea what was going on:
Original file: 192x96, 8 tiles (so, 4x2, each tile is 48x48)
Modified file according to rakoonic’s solution: 200x100 (50x50 tiles to account for a 1px border)
Modified file with power-of-2 canvas: 256x128 (still 50x50 tiles but with some junk space)
I proceeded to add the border value to Lime-tileset.lua (manually; Lime isn’t really built to accept borders yet) and got this:
Incorrect number of frames (w,h) = (48,48) with border (1) in texture (w,h) = (256,128). Failed after frame 9 out of 10.
Yes, that is an obvious assert message that Corona is using simple image sheet mode and obviously can’t read in an invisible tile that is not even 48x48 large. It confused me at a glance because I mistakenly assumed Tiled and/or Lime would only deal with the tiles specifically being used as opposed to simply reading in the strip.
But let’s say we use the 200x100 tile set instead. In Tiled, we set the spacing between tiles to 2px. What happens?
TIled: Looks fine!
Corona? Loads fine, no error messages.
Lime? Not so much. The map is there, but it looks like a chessboard at any resolution.
After trying a dozen different combos (a long and tedious process since you can’t preview anything or do a 1-for-1 tile set replacement) the correct Tiled Tileset settings are:
Tilesize: The original tile size before making the bleed/extrude modifications. (i.e.: 48x48)
Margin: 1px
Spacing: 2px
Offset: 0/0px
(just make sure you add this to options to look like this on lime-tileSet.lua or it won’t look right no matter what you do…)
sheetContentHeight = self.height, -- need the comma here
border=1, -- border size per tile
- We’re both right on Texturepacker. It does work, as you say, to quickly extrude tiles. But unless I’m missing some feature, TP cannot distinguish between tiles within the same file; they all have to be separated into separate .png’s first. That’s fine if you only have a few, but, as I said, untenable at 50-100+. Instead a google search suggests imagemagick:
ImageMagick: convert -crop 48x48 myoriginal.png mytiles\_%d.png
…might do the trick? [import]uid: 41884 topic_id: 10803 reply_id: 116634[/import]