| Allegro CL version 6.2 Minimally revised from 6.1 |
Arguments: stream from-pos to-pos &key (length 20) (width 10) fill
draw-arrowhead draws a simple arrowhead at to-pos for a line that was drawn between from-pos and to-pos. Typically an application will first call draw-line to draw an actual line, and then call draw-arrowhead zero, one, or two times to optionally add arrowheads to either end of the line.
the arguments are:
cg-stream
.
nil
,
t
, an RGB color object (see make-rgb), or an HLS color (see
make-hls). This
argument indicates how the arrow is to be filled.
If the value is nil
(the default), the arrow
is filled in the current background-color of the stream.
This creates the effect of a hollow arrow (with the background color
showing through the arrowhead), though in fact the interior is still
filled in order to cover over the end of the actual line that was
drawn beforehand.
If the value is t
, then the arrow is filled
with the current foreground-color of the stream,
which is the color that is always used to draw the border of the
arrowhead; this creates a solid arrow.
If the value is an RGB or HLS color object, then the arrowhead is filled with that color. This option may be used to fill the arrowhead with a different color than is used for the border of the arrowhead.
Here is an example function that draws arrows at various angles.
(defun test-arrowheads (&key (length 20)(width 10)) (let* ((window (make-window :arrows :class 'bitmap-window :title "Arrowheads" :interior (make-box 200 200 600 600) :scrollbars nil)) (pane (frame-child window)) (center #.(make-position 200 200)) coord side) (with-positions (pos1) (dotimes (j 9) (setq coord (+ 200 (* 40 (- j 4)))) (dolist (fill (list nil t)) (setq side (if fill 360 40)) (nmake-position pos1 side coord) (draw-line pane center pos1) (draw-arrowhead pane center pos1 :fill fill :length length :width width) (nmake-position pos1 coord side) (draw-line pane center pos1) (draw-arrowhead pane center pos1 :fill fill :length length :width width))))))
Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. This page has had minimal revisions compared to the 6.1 page.
Created 2002.2.26.
| Allegro CL version 6.2 Minimally revised from 6.1 |