Tilesheet centerPoint bug on Html5 target

Hello masters! With a new OpenFL (3.3.8) I’m getting a bug when using Tilesheet’s addTileRect method with a centerPoint set. Instead of use it as a center point it just crops an image (html5). On android there is no such problem.

Hello Monz, after half a day trying to figure out why I’d been getting no output at all for html5 target since upgrading to OpenFL (3.4), i’ve narrowed it down to this problem too. replacing my “tilesheet.addTileRect(tilerect, tilepoint);” with just tilesheet.addTileRect(tilerect); and i see something, although now incorrectly placed. Last version i have that it was working in was 3.1

There’s also a unrequested vertical line being rendered by the Tilesheet renderer, at positon 0,0, of width 1 px and height approx 250 px , which changes colour depending on nearby animated objects - (I’ve noticed it’s precense since 3.3.8)

Hello Penry, yes this is an unpleasant issue. As I use TileLayer library, to render Tilesheets, I’ve dodged from this problem thanks to offsets.

Hello Monz, some further investigation, and i’ve found what rectifies the cropping when using tilesheets with non (0,0) center points. I know you’ve moved on to Tilelayer, but am posting in case others come across this thread with the same problem as we had. it’s resolved by adding the following lines to the project XML file.

<set name="webgl" if="html5" />
<haxedef name="webgl" if="html5" /> 

Without this within the Project.xml, i still experience the strange clipping we both experiences (and i expect, a massive reduction in performance)

The vertical line i mentioned was entirely the fault of the tilesheet creating software i was using, and a subsequent optical illusion created when the animation was clipped (so nothing OpenFL related at all)

Hello Penry, unfortunately, it can’t be good for everyone… If you use WebGL in your html5 target, it won’t work properly in mobile browsers (it doesn’t supports there)…

I believe WebGL is supported in all major mobile browsers?

WebGL also falls back to canvas if WebGL is not available, so it won’t just break, though it will reveal any issues (like this one with canvas drawTiles)

If anyone sees how canvas drawTiles can be improved here, let me know. Probably a minor fix (I’m afraid I can’t work on a fix yet due to other stuff on my plate right now)

I’m sorry for my delusion, looks like WebGL really supports in a major mobile browsers. Also just made a WebGL build for testing and my html5 started working too slow… Is it only good for 3d? Or it’s because of Tilesheet render?