In binary transparency mode (also referred to as full transparency), colors in an image are either fully transparent or fully opaque.
This mode applies to most Alambik 2D objects :
The above-mentioned Alambik 2D AVOs supporting binary transparency can be divided into two categories:
1.1.1. The objects produced from one or several bitmaps
created outside the Alambik environment.
Icon, Picture, Panel, Button, Sprite, Scroll and Mouse objects are all composed of bitmap images.
Such bitmaps can be created outside the Alambik environment using 2D illustration software.
To employ images created outside Alambik, make sure they've first been saved in either the ".gif" or the ".png" format.
The transparency color in your imported ".gif" or ".png" images will be considered transparent by Alambik when they are used within an Icon, Panel, Button, Sprite, Scroll or Mouse object.
By default, the Picture object will treat the transparency color as opaque.
1.1.2. The Objects created within Alambik with no outside bitmap.
Binary transparent objects can also be directly generated within Alambik, without needing to create bitmap images outside of the scripting environment.
This applies to:
By default, the background color for Text, Menulist and Viewport objects is black. Their default text color is white.
Similarly, for Viewport objects, meshes and scenes are displayed by default against a black background.
For example :
To create a Virtual Screen, use the instruction screen.set to designate
a bitmap image to become the target for all graphic display.
In this case, any pixels which have not been designated to be colored will be transparent.
In a different section we have described the three Alambik screens:
MID, BACK and FRONT, each of which can contain up to 65,535 layers.
In order to illustrate the different ways transparency and persistence work, we've included a few examples:
1.2.1. Icon object, default behavior :
1.2.2. Icon object, transparency OFF :
1.2.3. Icon object, persistence ON :
1.2.4. Picture object, default behaviour:
1.2.5. Picture object, transparency ON :
1.2.6. Picture object, transparency and persistence ON :
Alambik features two color management modes:
1.3.2. RGB True colors:
To make this conversion, use the instruction number.color.convert
For example, if you want to make the RGB True color (97,122,155) of a sprite transparent, you would do the following:
sprite.color.swap.stack (number.color.convert (97,122,155), COLOR_TRANSPARENCY)
Instructions featuring the clear action allow you to erase pixels from a chosen portion of the current Alambik screen. For example,
188.8.131.52. One exception: ".fli", ".flc", and
animated gif sprites.
Progressive transparency lets you apply transparency to all the pixels in an image according to degree.
Progressive transparency functions correctly only if all screen elements are of the same kind (either all persistent or all non-persistent). It should also be noted that this functionality, unlike that of total transparency, does not take into account other Alambik screens.
As a result,