TiledMap bug #29
Comments
Were you running Chrome, and did this happen as you moved around? There is a known issue in Chrome where it is optimizing out some of the texture changes for Sprites (which is how the Layer culling is done). See the discussion @GoodBoyDigital and I had in GoodBoyDigital/pixi.js#48 |
Yes, this is Chrome and no, I just loaded TileMap to stage by calling loadWorld. Btw when I resizing window all tiles goes to hell. |
Resizing doesn't work properly yet, I'm working on it. |
Send me your tmx and tileset and I will see if I can figure it out |
Looks like there may be a bug in the TiledEditor or a mistake in your map, here is the data line for the water that is glitching:
As you can see there is a random number of Maybe this is left over from some other tileset? Maybe the TiledEditor is exporting these improperly? Maybe the importer you used has a bug? |
Woah @englercj, my bad. |
I know what causes those - it's Tiled being bloody ridiculous when you FLIP a tile horizontally or vertically! What it does is graphically flip the tile and then bit flip the tile ID as well. I've no idea why on earth it does this, it seems a bit nuts to me. I raised it with the Tiled devs but apparently it's how it should work. Grrrrr. Anyway - don't use tile flipping in Tiled and you'll not see this happen. |
@photonstorm The reason it does that is because tiles being flipped (or rotated) are marked by bitmasks.. At the time of this bug grapefruit didn't support flipped tiles, but it does now (see TiledTileset#L169). Lttp flips tiles all around and they work fine :) I think the reason they chose to use a bitmask is because a single tile on the map has no metadata associated with it except the tile id in the data array, so there is no where else to put it without creating some new objects somewhere, or masking it in. I guess we are lucky they stayed in the 32-bit range, or we would have some issues supporting it in JS 👅 |
Hey @englercj! I found one strange thing about TiledMap importer:
You can see it by cloning and running this branch: https://github.com/floatdrop/Aux/tree/grapefruit
The text was updated successfully, but these errors were encountered: