Name
SetDash -- set line dashing style (V5.0)
Synopsis
SetDash(offset, on1, off1, ...)
Function
This function can be used to define a dash pattern for paths drawn by DrawPath(). A dash pattern consists of an unlimited number of on and off line sections that start at the offset specified in argument 1. Starting with argument 2, you have to pass the length of the line section that shall be visible ("on-section") followed by the length of the line section that shall be invisible ("off-section"), and repeat this pattern as many times as you like. When drawing an outline path, DrawPath() will then apply this dash pattern to all lines it is drawing. When the dash pattern does not cover the whole line length, it will be repeated over and over again.

To remove the dash pattern, call this function with the second argument set to -1.

Please note that the line dash style is only used when drawing vector outlines. It is obviously not used when filling vector paths.

Also note that the inbuilt vectorgraphics renderer introduced in Hollywood 6.0 currently does not support line dashing. Use a fully featured vectorgraphics plugin instead if you need line dashing. See Vectorgraphics plugin note for details.

Inputs
offset
offset at which to start the dash pattern
on1
length of on-section 1
off1
length of off-section 1
...
optional: define as many on-/off-sections as you like
Example
SetFillStyle(#FILLNONE)
SetFormStyle(#ANTIALIAS)
SetLineWidth(10)
SetDash(0, 10, 10, 20, 20, 30, 30, 40, 40)
StartPath(1)
MoveTo(1, 0, 0)
LineTo(1, 640, 480)
DrawPath(1, 0, 0, #RED)
The code above draws a line using a dash pattern that first has four different on/off sections: The first on/off section is 10 units, the second 20 units, the third 30 units, and the fourth 40 units.

Show TOC