Name
SetTransparentPen -- set transparent pen (V9.0)
Synopsis
SetTransparentPen(pen[, t])
Function
This function sets the transparent pen in the currently active palette to the one specified in pen. Pens are counted from 0. By default, the current display's palette is the active palette but of course only in case the current display is a palette mode display. See Palette mode displays for details. A palette can be made the active one by using the SelectPalette() command.

Alternatively, the specified transparent pen can also be set to a different palette object. To do so, you need to pass the optional table argument to SetTransparentPen() and specify the Type and ID tags. See below for an example.

The following tags are supported by the optional table argument t:

Type:
Set this to the type identifier of the object whose transparent pen you want to set. This can be one of the following object types:

 
#ANIM
#BGPIC
#BRUSH
#DISPLAY
#LAYER
#PALETTE
#SPRITE

Note that if you use types #ANIM or #SPRITE, you also need to set the Frame tag (see below) to indicate the frame whose transparent pen you want to modify. If you use #LAYER and the specified layer is an anim layer, you also need to set the Frame tag.

Type defaults to the type of the currently active palette selected using SelectPalette(). See SelectPalette for details.

ID:
Set this tag to the identifier of the object whose transparent pen you want to set. The default is the identifier of the currently active palette selected using SelectPalette(). See SelectPalette for details.

Frame:
If the target type is an animation, sprite, or anim layer, you need to set this tag to specify the frame whose transparent pen should be set. Frames are counted from 1. Defaults to 1 when used with anims and sprites and to the current frame when used with anim layers.

Inputs
pen
desired transparent pen (starting from 0)
t
optional: table for specifying further options (see above)
Example
SetTransparentPen(4, {Type = #BRUSH, ID = 2})
The code makes pen 4 in brush 2 transparent.

Show TOC