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 for ILoadImageConfig: replace TransparentColorSamplePoint with TransparentColor #164

Open ghost opened 6 years ago

ghost commented 6 years ago

Using a pixel with particular coordinates to determine transparent color seems to be a "feature" which migrated from AGS, but in AGS it was related to the way how program UI works, where it let user to click on the image to choose a wanted color instead of setting color values explicitly.

From the coder's perspective, would not it be convenient to have just "TransparentColor" property? Which could in turn be set in various ways, such as setting it in script, reading from some data file or deducing from user's click on image preview.

tzachshabtay commented 6 years ago

Yes, I basically added this for the demo game because all of the assets are 16 bits. I doubt this feature will see much actual use, though. I assume the vast majority will use PNG with alpha.

I don't have any objections to changing how it works but I consider it low priority because of its supposedly being rarely used.

ghost commented 6 years ago

I changed my mind about this, since I was porting a test game from AGS. Although game is true color, many of the graphic assets do not use PNG transparency, but some (often random) background color. Don't remember why, maybe they were cut of some bigger mockup image. Anyway, telling engine to use certain pixel (like at 0;0) is definitely simplier in this case. Maybe this config struct could have both options (exact color and point).