-
Notifications
You must be signed in to change notification settings - Fork 135
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
flixel.FlxSprite:scale and flixel.FlxSprite:setGraphicsSize() vague descriptions #258
Comments
The docs could be improved to explain this, but to answer your question: it's important to remember that the hitbox and the graphic are entirely 2 separate things. While, in many cases, when a dev changes one, they are likely to make a similar change to the other, there are plenty of times that that is not the case, in fact, more-so than not the graphical bounds are slightly different from one another. It's important to be able to change graphical properties separate from collision properties and vice versa, and it's helpful to have methods that change both, proportionally. In fact we could use many more helpers in this area, when you think about offset and origin as well. So when you want to increase the hitbox size, you use
If I were to add say |
scale
setGraphicsSize()
From the description of
scale
it sounds likesetGraphicsSize()
will automatically update the hitbox, which it maybe doesn't ("It might make sense to call updateHitbox() afterwards!") according to the description ofsetGraphicsSize()
.It is most likely that the issue lies in
setGraphicsSize()
's description, and it should be clarified. Why does it might make sense to callupdateHitbox()
afterwards? Does it update hitbox or not? If it doesn't, thenscale
should also be fixed as it implies thatsetGraphicsSize()
does update the hitbox.The text was updated successfully, but these errors were encountered: