Drawing Statement
Draw a line in a graphical object.
[[color] COLOR] draw
{[by] XOFFSET YOFFSET [,XOFFSET YOFFSET] ...
to X Y [,X Y] ...}
color COLOR
A string value, integer value, or color keyword representing an ESL color. This draws the line (or sets of lines) in the specified color, overriding all other color specifications that otherwise would affect this drawing statement. If you omit this specification, ESL draws the line (or sets of lines) in the color specified in a pattern reference or object definition.
by XOFFSET YOFFSET
Draw a line from the current position to a new position that is offset from the current position by XOFFSET and YOFFSET, which must be integer values representing the relative offsets of the end of a line.
to X Y
Draw a line from the current position to a new absolute position specified by integer values representing the absolute X and Y coordinate positions of the end of a line, in the coordinate system of the object.
Description
ESL begins at the current position of the graphics cursor. The draw statement moves the graphics and text cursors exactly as the move statement does, but it also draws a line from the old position to the new.
You can specify any number of sets of coordinates in a draw statement; ESL will continue to move the cursor and draw additional lines. Be sure to separate each set of X and Y coordinates with commas.
You must specify a separate draw statement for each different color. See the example of the Blackboard_GR graphical region that follows.
Example
key Redo_Key at position 50 25
draw 20 40 # The line is white.
response to Redo_Key
add to Redo_Key
red draw 50 50, 50 0, 50 -50 # The lines are red.
graphical region Blackboard_GR size 100 100
at position 10 5
blue foreground
draw to 100 150 # This line is blue.
# The following line is drawn in the color stored
# in the Color_A_SV variable:
color Color_A_SV draw to 25 25, 100 100
See Also
draw arc Drawing Statement
move Drawing Statement