Legacy GM Fastest way to draw many sprites (static/animations)

JasonTomLee

Member
Hey GM Devs!
I never really thought about this question but how would you draw hundreds of sprites w/the least amount of lag? I know that creating hundreds of objects is not the way to go haha.
But from what I know, using tiles or surfaces is the most efficient way to draw static sprites?
 
M

MishMash

Guest
If they aren't moving, you could build a vertex buffer (For maximum speed), though this is a little tricky, and it would require that all sprites are on the same texture page. This would allow to literally render millions of sprites on a decent computer, so long as they aren't moving.

Internally, GM does build dynamic vertex buffers when drawing lots of the same sprite back to back, though it wouldn't be as fast as a statically created vertex buffer at the start of a level. The only downside is that building this vertex buffer may take some time, though if we are only talking about a few hundred, this should be fine.

Have a look at the help docs to get started: https://docs.yoyogames.com/source/d.../primitive building/vertex_create_buffer.html
 
Top