WritePen(x, y, pen[, t])
pen to the position specified by x and y in the currently
active palette object. By default, the current display is the active palette object but of course only
in case the current display is a palette mode display. See Palette mode displays for details.
You can set the active palette object using the SelectPalette() command.
Alternatively, you can also use WritePen() to write a pen to a different palette object.
To do so, you need to pass the optional table argument t to WritePen() and specify
the Type and ID tags. See below for an example.
The following tags are supported by the optional table argument t:
Type:
#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 pixel data should be used. 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 object selected using
SelectPalette(). See SelectPalette for details.
ID:
Frame:
WritePen(0, 0, 10, {Type = #BRUSH, ID = 2})
The code plots a pixel that uses pen 10 to the top-left corner in brush 2.