-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix a regression with FlxSprite's _maxFrames calculation. #181
Fix a regression with FlxSprite's _maxFrames calculation. #181
Conversation
The current approach assumed perfectly filled spritesheets rows. It used ceil() to adjust any floating value, which resulted in a blank column at the left of some graphics. I've noticed that testing with a game that uses particles. Some particles had that blank column. Removing the ceil (which was Adam's original approach) fixed the problem.
We discussed this one before:
The problem with not using any sort of rounding is that the value of Say, if your sprites are 10px each, the sprite sheet 45px wide and 40px tall, using Personally, I would prefer using |
I remember our discussion. For some reason I had in my mind the idea that we used Using I think we should merge this pull request, since it will prevent lots of "blank" or "half-blank" frames all over the place after people start using Flixel Community (my game included). |
Oh, right. Yes, that would do the trick. Although, would it be possible to explicitly run it through Do you want to add that warning if the sprite sheet is a few pixels too large as well, or push it up to a future version? |
I've just added the |
The code looks flawless (there's not much one can botch by accident in two lines ;) ). Could test this in one of your games, and if it fixes the problem, go ahead and merge this? |
haha, indeed there's not much to mess up in two lines :) I've tested and everything looks good. |
…ames Fix a regression with FlxSprite's _maxFrames calculation.
The current approach assumed perfectly filled spritesheets rows. It used ceil() to adjust any floating value, which resulted in a blank column at the right of some graphics.
I've noticed that testing with a game that uses particles. Some particles had that blank column. Removing the ceil (which was Adam's original approach) fixed the problem.