-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 C# examples to PropertyTweener docs #99736
base: master
Are you sure you want to change the base?
Conversation
doc/classes/PropertyTweener.xml
Outdated
{ | ||
Tween tween = CreateTween(); | ||
// Interpolate the value using a custom curve. | ||
Tween.TweenProperty(this, "position:x", 300.0f, 1.0f).AsRelative().SetCustomInterpolator(TweenCurve); |
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.TweenProperty(this, "position:x", 300.0f, 1.0f).AsRelative().SetCustomInterpolator(TweenCurve); | |
Callable tweenCurveCallable = Callable.From((float value) => TweenCurve(value)); | |
tween.TweenProperty(this, "position:x", 300.0f, 1.0f).AsRelative().SetCustomInterpolator(tweenCurveCallable); |
This one compiled and ran for me, though I'm not confident this is the preferred way to create a callable in this case. Needs a review from a C# expert.
(Used this page: C# Callable)
I have amended this PR with the changes that were suggested. I don't know if I was supposed to create a new commit in the process but there is a new one here with the changes to the code. |
Yeah, I'm not sure exactly what happened but it looks like you have two commits instead of a single amended commit. It's not a big deal, just means that you'll have to squash after all the reviews. I'm marking all the changes that I suggested and that you applied as "resolved" (except for the callable one). In the future, if someone suggests a change and you apply it exactly as-is, feel free to mark it resolved yourself (but leave it unresolved if you're unsure, or if you didn't apply it exactly as suggested). Now we're just waiting on a C#-specific review; and once that's done you can rebase/squash into one commit. Good work! |
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.
The C# code examples look good to me, and I tested them in-editor. But this still needs a review from someone more familiar with C# callables and with C#-specific code style for examples.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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.
Thanks for contributing to the C# documentation.
Ok, i'll add these changes 👍 |
I have made the suggested changes to set_custom_interpolator |
So all the checks passed, what next? |
"All checks have passed" in the UI just means that the automated CI checks have passed. It's a prerequisite for approving a PR but not the only thing that needs to be done. You're still waiting for @raulsntos to come back and approve your changes. Once that happens, you'll have an approval from a docs reviewer (me) and one from a C# reviewer (raulsntos), and with two approvals from the relevant parties, the PR will be fully approved. Some time after that, but not immediately, it will be merged. |
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, thanks!
Should I squish the commits then? |
Yes, please squash! Forgot to mention that in the summary of next steps |
36e0fe7
to
90ec0aa
Compare
Ok I think I did it right |
Looks like you did. I'm not sure if it's a hard requirement for merging, but it would also be nice if you amended the commit message to be more descriptive, like the PR title currently is (I changed the PR title for you earlier). |
Adding C# examples to PropertyTweener Docs for the following methods as_relative from from_current set_custom_interpolator Co-Authored-By: tetrapod <[email protected]>
90ec0aa
to
7ba1789
Compare
So I think I amended it correctly but I don't see the changed description. |
Wait nevermind I see it |
It's showing up like this for me. Ideally it would be something more like:
instead of the current:
If you can't figure this out, it's probably fine, since the PR title is already good and the commit title and description are already reasonably descriptive 🤷. If it's actually a problem then the production team will let you know before merging. |
Are the other checks supposed to happen again? |
The checks aren't automatically run, since you're a first-time contributor. I thought the last change you made didn't change the content, so they should still pass. But it doesn't hurt to run the CI again. |
This is something that I am doing for a school project. I saw an issue posted to the Godot-docs repo about missing C# examples in the PropertyTweener class reference page. It is labeled as issue #9924 on the docs repo, not the main one, and can be found easily in the good first issues list.
I have added C# examples for the following methods.
as_relative
from
from_current
set_custom_interpolator
I used tools like the code translator as well as cross referencing with other areas of the documentation, primarily the Tween class reference was really helpful, but there are still some parts of this that I am not completely sure about. I doubt that I am getting this perfect on my first try here, this is the first time I have done anything like this, so feedback for my code and tips for how I can improve my examples and make them more accurate would be greatly appreciated. I hope I can take any feedback/criticism and use it to make this something that is up to standard.
Bugsquad edit: closes godotengine/godot-docs#9924