drawTiles issue with zame-particles

We integrated zame-particles into an openfl project recently, but were having some issues with DrawTilesParticleRenderer. The renderer, which uses drawTiles for more efficient particle rendering, was seemingly clipping the particles in odd ways.

We came across this PR in openfl, created by the zame-particles developer:

This PR was closed and another created, which was also closed. It is unclear if the issue was fixed or not. When we applied the patch it did not seem to affect the behavior in any way.

We did find a fix however, by applying the patch from the PR and then in the __drawTilesMode block in CanvasShape render setting the bounds to {0,0}.

			graphics.__bounds.x = 0;
			graphics.__bounds.y = 0;

This seems to fix the particle rendering, but we aren’t sure what the effect of this will be. Does this have performance implications? What is the current state of drawTiles in the html5 canvas renderer?

We are currently using openfl 3.6.0 and could upgrade to 3.6.1 if that seems likely to have relevant fixes in this area, but it would be problematic given that we have a bunch of local modifications to 3.6.0 in other areas.

Thanks in advance for any assistance and/or knowledge!


Hi. I’m the author of this library. As I understand, you use html5 with -Dcanvas mode.
OpenFL changed a lot from 3.2.2 to 3.6.0, and my older fixes is not working with latest version.
For OpenFL 3.6.0 can you try this fix instead?

If it doesn’t help, feel free to contact me at [email protected]

That worked like a charm! Thanks! and thanks for creating zame-particles. :slight_smile:

Spoke slightly too soon. While the issue is much improved the particles do seem to occasionally get clipped close to the bottom of the particle system.

I just fixed pull request, now it should work correctly (I hope :slight_smile: )

If it doesn’t help, can you try to use SpritesParticleRenderer as work-around?

That works. :slight_smile:

Thanks again!

SpritesParticleRenderer works perfectly btw, I was just hoping to use DrawTilesParticleRenderer for potentially better performance.

We have a couple of local changes/additions we’ve made to zame-particles. Would you be interested in those? We have a slight fix for alpha animation in SpritesParticleRenderer and also a loader for pixi-particles data files (that is a WIP but it might be of interest). If you are interested what is your preferred way to get those? should we make a PR for zame-particles? or just email it?


I want to have it all :slight_smile:

I prefer pull requests, but I will accept help in any form (email, etc.).