-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Improve documentation of CanvasItem
's draw logic
#64345
Conversation
05c548f
to
285e6f9
Compare
285e6f9
to
953c78e
Compare
Question, why is this scheduled for 4.x? |
To keep the 4.0 milestone clear after the roadmap freeze that we've announced two weeks ago. It can still be merged in 4.0, if it's reviewed and approved. But it doesn't seem to be essential for the 4.0 release. |
Thanks for working on this! The docs/class reference can really use more of this. A lot of meat is already there, but often the nuance/details you actually care about when looking at it as a gamedev can be improved.
TBH I'm not against adding a 'Note: This won't be called while the CanvasItem is not visible.' at the end of each affected method. |
I found it difficult to find the right balance. Too many details, especially if repetitive, and it does definitely feel overbearing to the user (that may not ever need this much definition). Too little, and it ends up looking like "Overridable function called by the engine (if defined) to draw the canvas item", although this one is particularly egregious, 'cause the user likely doesn't care about this. Reality is, |
Looks great to me, thanks! |
Cherry-picked for 3.6. |
Cherry-picked for 3.5.1. |
This PR changes a lot of the wording to better connect and explain the
_draw()
andupdate()
methods, thedraw
signal and the NOTIFICATION_DRAW.It takes heavy inspiration from how corresponding notifications and signals are worded in the Node documentation.
Here's the gist of why these descriptions have been modified:
update()
is appropriately called by core classes already. The last sentence oddly mentions the notification first and_draw()
last, and it ends awkwardly;_draw()
, it doing nothing when the CanvasItem is hidden, and noting thatNOTIFICATION_DRAW
is sent only once per frame, no matter how manyupdate()
are called.draw_*
methods when deferred;I wanted to mention more often that most of this doesn't work when CanvasItem is not visible, but I wasn't sure how in a way that feels right.
This can be cherrypicked to 3.x.