-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Use float instead of integers for durations in Tween
documentation
#102523
Conversation
Twee
documentation
Twee
documentationTween
documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
In general, I prefer docs (and sample code) having explicit float literals whenever the value being set is a float.
As this will invalidate translations, let's merge for 4.5-dev1, so translators have enough time to handle the fuzzy strings before 4.5-stable. |
@@ -402,7 +402,7 @@ | |||
[codeblocks] | |||
[gdscript] | |||
var tween = create_tween() | |||
tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, 0, -1), 1) # The look_at() method takes up vector as second argument. | |||
tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, 0, -1), 1.0) # The look_at() method takes up vector as second argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, 0, -1), 1.0) # The look_at() method takes up vector as second argument. | |
tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1.0, 0.0, -1.0), Vector3(1.0, 0.0, -1.0), 1.0) # The look_at() method takes up vector as second argument. |
If we are trying to use explicit float literals, why are we not using them for the Vector2/Vector3 constructors too, for consistency?
I don't necessarily think we should do so. But if we choose to keep the inconsistency we should do so intentionally and have some reason even if it's just "it's longer and doesn't increase clarity"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can handle this in a separate PR/discussion, no need to keep this one on ice in the meantime
Thanks! Congratulations on your first merged contribution! 🎉 |
I think it could be cleaner to use floats instead of integers, since duration is supposed to be floating numbers. In this case it doesn't make a big difference, but if you use integers instead of floats as target value in tweens, it can create unexpected results, so I think it could be cleaner to use floats when floats are expected, at least in the documentation itself.