---
name: "extrans"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/extrans/3alleg4"
---

# extrans(3alleg4)

Lighting and translucency effects. Allegro game programming library.

## NAME

extrans - Lighting and translucency effects. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**Example extrans**

## DESCRIPTION

This program demonstrates how to use the lighting and translucency functions. The first part of the example will show a dark screen illuminated by a spotlight you can move with your mouse. After a key press the example shows the full bitmap and the spotlight changes to be a reduced version of the background with 50% of translucency.

The translucency effect is easy to do in all color depths. However, the lighting effect has to be performed in a different way depending on whether the screen is in 8bit mode or another color depth. This is because additive drawing mode uses a different set of routines for truecolor modes.

## SEE ALSO

**BITMAP**(3alleg4), **COLOR\_MAP**(3alleg4), **END\_OF\_MAIN**(3alleg4), **PALETTE**(3alleg4), **RGB**(3alleg4), **RGB\_MAP**(3alleg4), **SCREEN\_H**(3alleg4), **SCREEN\_W**(3alleg4), **allegro\_error**(3alleg4), **allegro\_init**(3alleg4), **allegro\_message**(3alleg4), **bitmap\_color\_depth**(3alleg4), **blit**(3alleg4), **circlefill**(3alleg4), **clear\_bitmap**(3alleg4), **clear\_keybuf**(3alleg4), **color\_map**(3alleg4), **create\_bitmap**(3alleg4), **create\_bitmap\_ex**(3alleg4), **create\_light\_table**(3alleg4), **create\_rgb\_table**(3alleg4), **create\_trans\_table**(3alleg4), **destroy\_bitmap**(3alleg4), **draw\_trans\_sprite**(3alleg4), **drawing\_mode**(3alleg4), **install\_keyboard**(3alleg4), **install\_mouse**(3alleg4), **install\_timer**(3alleg4), **keypressed**(3alleg4), **load\_bitmap**(3alleg4), **mouse\_x**(3alleg4), **mouse\_y**(3alleg4), **poll\_mouse**(3alleg4), **rectfill**(3alleg4), **replace\_filename**(3alleg4), **rest**(3alleg4), **rgb\_map**(3alleg4), **screen**(3alleg4), **set\_alpha\_blender**(3alleg4), **set\_gfx\_mode**(3alleg4), **set\_palette**(3alleg4), **set\_trans\_blender**(3alleg4), **set\_write\_alpha\_blender**(3alleg4), **stretch\_blit**(3alleg4)
