tzachshabtay / MonoAGS

AGS (Adventure Game Studio) reimagined in Mono
https://tzachshabtay.github.io/MonoAGS/
Artistic License 2.0
27 stars 8 forks source link

Suggestion: add methods to create and load bitmap from resource to IGraphicsFactory #230

Closed ghost closed 6 years ago

ghost commented 6 years ago

There does not seem to be a proper method in factory API to load raw bitmap from resource. Not too often, but sometimes this may come handy, for instance if you want to use it as a logical mask, instead of displaying it on screen. There is a method to load bitmap from the stream, but that would require additional manipulations. Also it is "hidden" in the IDevice factory, and took some time to find.

This is a suggestion to add three simple methods to the IGraphicsFactory : GetBitmap(w, h) (named in accordance to GetSprite, etc, idk if it's the best name), LoadBitmap(resource) and LoadBitmapAsync(resource). Implementation basically copies necessary parts of loadImage.