-
Notifications
You must be signed in to change notification settings - Fork 482
add scaleGraphicSize
#3489
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
add scaleGraphicSize
#3489
Conversation
This is a very obfuscated way of doing this. The doc doesn't really clarify things for me but it looks like I say remove this new method, and add
While we're at it, So I went and did that: #3490 Edit: if you think there is some value in a method that scales a sprite relative to its current hitbox, then I'm open to adding that, but I would not call it |
Essentially, yes. I did it with the frame dimensions simply to fit in with
I don't see how this is confusing or problematic.
both are used for different purposes, like for example, scale down sprites from the same spritesheet. from 1080p to 720p, for example. or scaling images down that the developer intentionally trimmed the hitbox a bit so that it has more or less the same scaling down at any frame. the idea with scaleGraphicSize is to scale general spritesheets to a certain level, which the point PR that you added (although I think set should be an overloaded extern inline instead of its own function) is not the intended behavior. things like
it follows up the same name principle as |
I think if this already existed in this form, with this name and documentation and you stumbled across it, you yourself would find this confusing. it takes scale and determines a size, and passes it into a function that takes the size and determines the scale, rather than just changing the scale directly. Using the term "absolute" here is confusing as well, false is really "relative to the frame size" and true is "relative to the current hitbox". The term "absolute" should indicate "relative to the current scale" or "sets the absolute scale"
I would also just have two different functions for this rather than a bool, plus this further conflates hitbox vs graphic size which is a problem with a lot of FlxSprite tools. While I'm listing gripes, I also think
If you disagree, ask someone to weigh in. If you think this offers something that my PR doesn't, share a snippet that showcases that. |
I've been using
setGraphicSize
as a way to scale up/down images. While this gets the job done, of course, it's a bit tedious and setting the scale viasprite.scale.scale(0.5)
isn't as convenient since it scales it in an absolute level, not in a relative-like width, up and down.This fixes it, plus it doesn't affect it that much since it's mostly an extern inline to the already established
setGraphicSize
.