AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.4k stars 290 forks source link

Added Canvas.DrawImage (#784) #878

Closed SirePi closed 3 years ago

SirePi commented 3 years ago

As per #784, this introduces a DrawImage(Material / BatchInfo) to the Canvas. The code has been taken inspiration from FillRect, but feel free to add suggestions on how it can be improved

ilexp commented 3 years ago

Thanks! Finally managed to look into this again and update the review.

Instead of requesting a few more changes, I took the time to add them myself right away, to avoid going stale again, since I think this is a pretty useful feature. Some of the changes were not part of earlier review requests and only occurred to me when doing a more thorough review today, checking out the most recent changes. I know it's not the cleanest way to go through with this PR, but right now it's the best I can manage, given the limited time I have - sorry about that, but I hope that's fine with you.

Changes I made and rationale behind them: