adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
530 stars 127 forks source link

simpledisplay.d: blitting from spritesheets? #279

Closed quickfur closed 3 years ago

quickfur commented 3 years ago

The current API, AFAICT, only supports blitting an entire Sprite or Image to the window. Meaning that if I have a whole bunch of sprites, I have to create separate Sprite objects for them, and may run into system limits. Is there a way to add support for blitting sub-rectangles of a Sprite to the window instead? So I could load a spritesheet, say, and render sprites by blitting sprites from subrectangles of the sheet. That way I can greatly save on the number of Sprite objects I have to create.

adamdruppe commented 3 years ago

Yeah those are pretty easy to add on, even in a backward compatible way. Both the Windows and X functions support it, I just never forwarded the necessary arguments.

adamdruppe commented 3 years ago

I'll prolly do it tonight when back on my desktop if you don't beat me to it.

adamdruppe commented 3 years ago

well other random stuff included in the commit too but the master now has args for image upper left and size, lemme know if that works for you

quickfur commented 3 years ago

Awesome, works very nicely. Thanks for the prompt response!