;;; Author: Rico Howard ;;; Procedure: ;;; stick-man ;;; Parameters: ;;; none ;;; Purpose: ;;; Creates a new image with the stick figure in different poses ;;; Produces: ;;; Nothing. You call this only for the side effect of ;;; drawing a new image. ;;; Preconditions: ;;; Must be called from within Script-Fu. ;;; Postconditions: ;;; A new image appears on the screen. (define stick-man (lambda (width height val1) (let ((stick (create-image width height))) ; Draw everything on white (set-bgcolor WHITE) ; Set color or sticam to say..red (set-fgcolor (list-ref (list RED GREEN BLUE) (modulo val1 3))) ; Set brush type to circle 7 (set-brush "Circle (07)") ; Draw head of stick man (select-ellipse stick REPLACE (/ width 3) 0 (/ width 3) (/ height 3)) (stroke stick) (select-nothing stick) ; Draw body of stick man (line stick (/ width 2) (/ height 3) (/ width 2) (* height (/ 2 3))) ; Draw right leg of stick man (line stick (/ width 2) (* height (/ 2 3)) (* width (/ 3 4)) height) ; Draw left leg of stick man (line stick (/ width 2) (* height (/ 2 3)) (* width (/ 1 4)) height) ; Draw right arm of stick man (line stick (/ width 2) (* height .4) (* width (/ 5 6)) (/ height 3)) ; Draw left arm of stick man (line stick (/ width 2) (* height .4) (* width (/ 1 6)) (+ (/ height 4) (* 3 val1))) ; Now bring that stick to life!! (show-image stick))))