Skip to content
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

Idea: start adding a small number of properties to Surface #2758

Closed
Starbuck5 opened this issue Mar 19, 2024 · 0 comments · Fixed by #2813
Closed

Idea: start adding a small number of properties to Surface #2758

Starbuck5 opened this issue Mar 19, 2024 · 0 comments · Fixed by #2813
Labels
New API This pull request may need extra debate as it adds a new class or function to pygame Surface pygame.Surface

Comments

@Starbuck5
Copy link
Member

The Surface class has many getters and setters. Some of them are very commonly used and I feel that their verbosity can be cumbersome.

I'm thinking of

.get_size()
.get_width()
.get_height()

I think it would quite elegant to be able to do

.size
.width
.height

These would be read-only properties, I don't think it makes sense to try implement scaling when these are changed.

Why am I thinking of these and not other getters/setters? These are the good starting ones in my opinion, because they're common and seem pretty unambiguous.

What do other people think?

@Starbuck5 Starbuck5 added New API This pull request may need extra debate as it adds a new class or function to pygame Surface pygame.Surface labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New API This pull request may need extra debate as it adds a new class or function to pygame Surface pygame.Surface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant