pygame-ce icon indicating copy to clipboard operation
pygame-ce copied to clipboard

pygame.draw.rects

Open ScriptLineStudios opened this issue 1 year ago • 4 comments
trafficstars

Could be implemented in either of the following ways:

pygame.draw.rects(surf: Surface, color: Color, rects: List[Rect])
pygame.draw.rects(surf: Surface, sequence: ((Rect, Color), ...))

If we go down this route we may as well implement this issue in full - https://github.com/pygame-community/pygame-ce/issues/1628

ScriptLineStudios avatar Jan 15 '24 11:01 ScriptLineStudios

Also since this is new API, we could just return None instead of a list of rects here, so as to speed up the whole thing even more (this will probably even make these functions work faster with single values than current single draw function that have to build and return a rect)

Matiiss avatar Jan 15 '24 17:01 Matiiss

May I remind you of these?

  • https://github.com/pygame-community/pygame-ce/pull/1839
  • https://github.com/pygame-community/pygame-ce/pull/1841
  • https://github.com/pygame-community/pygame-ce/pull/1834
  • https://github.com/pygame-community/pygame-ce/pull/1835

itzpr3d4t0r avatar Jan 15 '24 17:01 itzpr3d4t0r

And this: https://github.com/pygame-community/pygame-ce/issues/2208

itzpr3d4t0r avatar Jan 15 '24 17:01 itzpr3d4t0r

And this: #2208

Alright, so just expand existing functions, can we still make them not return a list of rects if you pass in a sequence then?

Matiiss avatar Jan 15 '24 17:01 Matiiss

This issue comes under the same umbrella as https://github.com/pygame-community/pygame-ce/issues/2208 so for issue gardening purposes I will close this one

ankith26 avatar Oct 19 '24 12:10 ankith26