Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxFilterFrames.applyToSprite: add to, rather than wipe previous offset #2176

Merged
merged 1 commit into from Sep 28, 2018

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Sep 28, 2018

Adjusts the current offset rather than ignoring its previous offset entirely. applyToSprite is typically used to add a glow or blur filter to an existing sprite sheet, typically it's desired for the hitbox to only cover the original graphical area so the offset is changed, but it assumed the original offset was 0,0. this change accounts for the previous value

fixes #2175

@Geokureli Geokureli changed the title add to, rather than wipe previous offset FlxFilterFrames.applyToSprite: add to, rather than wipe previous offset Sep 28, 2018
@Gama11
Copy link
Member

Gama11 commented Sep 28, 2018

Hm.. what if you apply multiple filters?

@Geokureli
Copy link
Member Author

the number of filters nor the size of the filters supplied per FlxFilterFrame doesn't matter so much, the sprite's size will only increase by the amount specified, and the resulting graphic will always have the old graphic centered evenly within it.

This issue was discovered when my game calls FlxFilterFrame.fromFrames(...).applyToSprite(...) on the same sprite iteratively. the hitbox became more "off" with every iteration.

@Gama11 Gama11 merged commit c9f72fe into HaxeFlixel:dev Sep 28, 2018
@Geokureli
Copy link
Member Author

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants