![]() ![]() |
An Alambik graphics object is considered transparent if you can see through it (or any portion of it), making the background or any graphic objects behind it visible. Transparency can be either binary or progressive. |
![]() ![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1.1. Defining the transparency color. 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 : · Text 1.1. Defining the transparency color: 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. 1.1.1. The Objects made from one or several bitmaps: 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. For Example:
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: · Text, Menulist and Viewports. 1.1.2.1.The Text and Menulist and Viewport objects: By default, the background color for Text, Menulist and Viewport objects is black. Their default text color is white. For Example:
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. 1.2. Binary transparency and Alambik screens. 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 :
1.3. Changing the transparency color: Alambik features two color management modes: 1.3.2. RGB True colors: There is no transparency color in this mode. To make an RGB True color transparent, you must either transform it into a pre-defined color, or clear pixels. 1.3.2.1. Converting an RGB True color into a pre-defined color: 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,
1.3.2.3. One exception: ".fli", ".flc", and
animated gif sprites. |