-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Allow passing special_flags
to Group.draw
#3306
Comments
Good idea, thanks for pointing it out. For someone who will try to implement i, try to see if https://pyga.me/docs/ref/surface.html#pygame.Surface.fblits could be used. Also, I think droid is modifying sprite atm, so maybe then we can implement this as well |
The reason why This feature should be easy to implement though. |
Honestly I wouldn't think this should be added, it's extra API for a niche use, could be accomplished by overloading draw (I think?), and philosophically I think sprites should be responsible for how they are drawn, not what group they are in. However, since you've gotten this added to pygame/pygame, and we would like to be compatible with pygame/pygame, I guess we should do it. @MarcellPerger1 Would you like to open a PR? |
Yes, I'm happy to open a PR when I have a bit of time (probably this weekend) |
Description
Add a
special_flags
argument toGroup.draw
(and all the other group classes).This would be useful as with this feature, I could write code like this:
instead of
Also, for more complicated group classes (eg.
RenderUpdates
), you have to copy the entire code of the.draw
functions and change just the line where the.blit
method is called which is quite annoying.See pygame/pygame#3719 for the issue I opened over there (before I found pygame-ce).
The text was updated successfully, but these errors were encountered: