-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Improved blit()
docs
#2262
Improved blit()
docs
#2262
Conversation
fe971c0
to
2fa784b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Here's an idea to chew on. What if the special flags explanation was a completely separate page, like the list of default colors in pygame.color. Right now the function is more daunting to look at because the description is so detailed, and a lot of that length is now coming from the special_flags documentation. |
Yeah I have kind of the same feeling there, but for now i guess i could just move the flags to the surface class and mention that in the blit docs. While this may not be a long term solution, it should give me some more time to work on the Surface class, make that better, and move flags out of there. Though idk if it's strictly necessary to create a separate page as for now we only got a handful of flags so yeah, we shall see. |
Just for reference this is what I'm talking about: https://pyga.me/docs/ref/color_list.html. Whole separate page not in the modules top bar. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Should this be implemented in this PR or a followup? |
I just don't like that this PR seems to make the blit docs significantly longer, when part of the issue being brought up by OP was the docs being too long and overcomplicated for entry level users. I'm not sure how you'd like to tackle this in PRs. |
I don't find these docs too overcomplicated, maybe a bit too long still but mind that writing docs isn't an easy task, as is demonstrated by how poorly our docs are written (my fblits docs as well). With this PR I think I added a lot more information that wasn't even there before, and organised it in a way in which if you're a beginner you can simply read the first 6 lines and you are fine but if you're an advanced user you can go more in-depth further down. Sorry but aside from it beeing a bit too long and the possibility of making a separate page for special flags i just don't see how these docs are bad. They are better structured, have a clear begginner at the top and advanced at the bottom structure, add meaningful information that you could've only gotten with errors/debug. |
f1021fd
to
4a2696c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e423fdd
to
c1a5b18
Compare
Went over this a bit again.
|
docs/reST/ref/special_flags_list.rst
Outdated
Uses premultiplied alpha blending for faster and accurate results when | ||
the color channels are already multiplied by the image alpha channel. | ||
You should only use this blend mode if you previously premultiplied the Surface with | ||
:meth:`premul_alpha()`. Check out :doc:`surface`'s :meth:`premul_alpha()` method for more |
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.
Rather than referencing a class and then referencing a method, you could just reference Surface.premul_alpha directly.
So now the list of parameters is not a bulleted list at all, which looks weird to me. The pygame functions usually have a bulleted list of parameters (draw) or paragraphs. There is now a bulleted list of notes, which is better than before. But it's just weird that almost all the notes directly map to one parameter. Like why not have the information in the parameter descriptions? |
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 over all - I added a couple of small suggestions.
Thanks for the hard work on this 👍
Looks like this one needs a merge with main to clear the CircleCI fail. |
added separators and slight correction shortened blit docs removed redundant note, slightly better default blend_flag description removed special flags section in blit added some highlights to the last note better notes, separated param descriptions into separate sections various rephrases to improve passive voice use and readability added more info about the default blend flag. cleanup moved the special flags section to Surface(), addressed reviews. changed the way sections are made removed "-"s to align all cases substantially changed special flags descriptions added comment on how the alpha channel is treated some other minor changes some corrections
This reverts commit eeff064.
- moved noted to bullet list - moved special flags list to a separate page
Co-authored-by: Dan Lawrence <[email protected]>
7f80754
to
21f5644
Compare
Outdated review and reviewer wasn't active for a long time
Follows #2259. This one aims to improve the
Surface.blit()
function's docs since it's one of pygame's most used functions. I heavily encourage feedback as this is just a starting point. I tried to make docs easy to read and comprehend to a beginner but i may have rephrased some things wrong and/or made big mistakes.Added:
Removed:
OLD:
NEW:
The blit docs no longer list all blend flags and the blend flag descriptions have been moved to a separate section in the Surface object description:
This is to offload function docs of a repetitive blend flags description while providing a more in depth description of what each flag does.