Image Overlay and Transparency

I have an idea I want to explore, using a location window (permanent room image display).

Is there a way to draw a foreground image over the top of a background image, with transparency? Say, like a ghost appearing and disappearing?

Standard transparent PNG images will work.

The underlying infrastructure definitely allows this through, as Dannii says, PNGs with either transparency information or a full alpha channel. Depending on what precisely you’re trying to do, you may well have to delve into low level Glk system calls to make it happen, though.

I was considering a game where the player is fighting against illusions; the more he believes in the illusion, the more faintly he can perceive the real room.

This could be done with many different images, each corresponding to a transparency gradient, but it would be much simpler (and spare more memory) to decide the transparency at run-time.

Through Glk you don’t have any control of the underlying bitmap or the alpha channel, so you can’t change the opacity of an image at run-time. It might be possible to do something clever with Vorple if you want to go the web browser / Javascript route, otherwise I’d stick to pre-generated images.