[Solved] Tilesheet drawTiles bugging out on HTML5 and Flash targets?

I am fully aware that using Tilesheets is optimized for native targets, but I though that it still works relatively well in HTML5 and Flash with only a few tiles. However, when I tried to use it for those targets, some of the tiles don’t render.

Whether they render or not depends on how many things are being rendered at any given time. Is there a way of solving this?

On those targets, it might be best to fall back to the display list. The Tilelayer library will automatically do this for you.

Do you have any sample code that might recreate this? I’m not aware of this issue, it might be a bug elsewhere in the code?

Yes, I am starting to think that it might just be an error in the way I called drawTiles. I’m using a custom framework on top of OpenFL, so it might be too much code to sift through. The curious thing is that this error only appears in HTML5 Chrome (which I should’ve mentioned earlier, sorry) and Flash. It works fine on Mozilla.

Oh, that’s strange. Perhaps it has something to do with objects that are off-screen (or some other bad value), sometimes canvas gets upset if you try something invalid. A case to reproduce would be helpful, but maybe like you said, it’s too complex to boil down

Okay, I have managed to isolate the problem. I was performing a sort every render frame (since drawTiles doesn’t have layering out of the box, if I remember correctly), so for some reason it lags or errors on those targets. Although this puts into question why it would lag, I understand now that this is not at all a drawTiles issue. Sorry for the false alarm.

EDIT: Not related to the drawTiles issue, but the sorting messing up was because I used the built in sort of the array object, whereas I should’ve used the recommended ArraySort.sort().