renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
326 stars 64 forks source link

Fixed LayeredUpdates.get_sprites_at(pos) by passing a list of Rects #68

Closed hsandt closed 6 years ago

hsandt commented 7 years ago

I am fixing https://github.com/renpy/pygame_sdl2/issues/67 by passing a list of Rects instead of a list of Sprites to rect.collidelistall() in LayeredUpdates.get_sprites_at(pos) (method b. in my post).

If you prefer method a. (init a Rect from any object with a "rect" attribute), ask me and I'll modify rect.pyx instead.

renpytom commented 7 years ago

Hm... sprite.py is taken from pygame, so I think we should be changing it if we don't have to. It means that we're not compatible with the rest of pygame. So I think rather than doing that, we should go with method a - make rect more compatible with the pygame way of doing things.

hsandt commented 7 years ago

OK, no problem. It will be a bit longer but feasible with hasattr and getattr. I'm not working on my Pygame project right now but when I get back to it, I'll try method a.