HaxeFlixel / flixel-demos

Collection of demos for HaxeFlixel
https://haxeflixel.com/demos
422 stars 291 forks source link

fix rotation on flxfilterframes demo #349

Closed ninjamuffin99 closed 2 months ago

ninjamuffin99 commented 2 months ago

I believe in FlxFilterFrames.applyToSprite() function, it adds an offset (from this flixel merge/pr https://github.com/HaxeFlixel/flixel/pull/2176)

here we simply just reset the offset to the sprite, so it doesn't adjust the offset incorrectly and constantly increment it

Geokureli commented 2 months ago

so it seems the issue is that it adds the offset every frame, but it should only add the offset when the filter wasn't active previously?

ninjamuffin99 commented 2 months ago

right, so could be something that's changed within flixel itself!

could also do something like account for it's current offset maybe. I'll leave the flixel side up to you though :)

Geokureli commented 2 months ago

I'm not entirely sure what the best course of action is here, I think FlxFilterFrames usefulness is highly situational, I don't think I would use it in the way this demo does, where it generates new frames every update, and I think it's mostly a leftover feature from flixel's blitting days. for most of these I would try to use a shader, but even that isn't a perfect solution

I've decided to merge this, and take a look at FlxFilterFrames to see if there's a way to un-apply the current effects before re-applying, but really this class might need a rewrite

Geokureli commented 2 months ago

Thanks!