Culling offscreen sprites?

17 views
Skip to first unread message

Jacob Weinbren

unread,
Oct 23, 2013, 2:21:06 PM10/23/13
to rab...@googlegroups.com
Hi all!

How would I make a project where I would render about 300 sprites on a screen and cull those offscreen? Also considering scrollx and y from keyboard. I'm using pyglet.

Thanks.

Aj.

Ryexander

unread,
Dec 17, 2013, 1:37:54 PM12/17/13
to rab...@googlegroups.com
I achieved this by maintaining a Numpy array of the sprites and using array slicing and masking to remove off screen sprites. 

I maintain a parallel array of true false values for if the corresponding sprite in on or off the screen and then use it as a mask for the numpy array.
Reply all
Reply to author
Forward
0 new messages