Skip to content

Commit

Permalink
fix rotation on flxfilterframes demo (#349)
Browse files Browse the repository at this point in the history
* fix rotation on flxfilterframes demo

* remove bitmapfilterquality import

* add comment

---------

Co-authored-by: George Kurelic <Gkurelic@gmail.com>
  • Loading branch information
ninjamuffin99 and Geokureli committed Apr 30, 2024
1 parent aa16cd7 commit d2ffcfe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Effects/FlxSpriteFilters/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,27 @@ class PlayState extends FlxState
}
if (isAnimSpr2)
{
spr2.angle += 45 * elapsed;
updateFilter(spr2, spr2Filter);
}
if (isAnimSpr3)
{
spr3.angle += 45 * elapsed;
updateFilter(spr3, spr3Filter);
}
if (isAnimSpr4)
{
spr4.angle += 45 * elapsed;
updateDropShadowFilter(elapsed);
}
if (isAnimSpr5)
{
spr5.angle += 45 * elapsed;
updateFilter(spr5, spr5Filter);
}
if (isAnimSpr6)
{
spr6.angle += 45 * elapsed;
updateDisplaceFilter();
}
}
Expand All @@ -200,6 +205,8 @@ class PlayState extends FlxState

function updateFilter(spr:FlxSprite, sprFilter:FlxFilterFrames)
{
// Reset the offset, it will ballon with each apply call
spr.offset.set();
sprFilter.applyToSprite(spr, false, true);
}
}

0 comments on commit d2ffcfe

Please sign in to comment.