I’m not a coder and I don’t really know how to explain it. I search on the web for a hard explanation and I could find much. I use and exemption on what I saw and read from different places. This link gave a little perspective.
https://renenyffenegger.ch/notes/design ... ions/index I learned from
https://www.gimp.org/tutorials/Basic_Scheme2/ How to draw a line procedure, setting the cons-array and setting the coordinate points with this sample.
(set! points (cons-array 4 'double))
(aset points 0 0) ; (x0, y0)
(aset points 1 0)
(aset points 2 320) ; (x1, y1)
(aset points 3 240)
(gimp-paintbrush-default layer 4 points)
I know you need at least two points coordinate x, y in your image to construct an array. With GIMP “aset function” you can fill those coordinates values. I figured that if you make those coordinates points in the same place on the Canvas, it will fill with a value(s). In my case, I have a 700 x 700 square canvas and I set the both points x, y at 350, (center) and used an constant array of doubles. This I figured that will paint the “Star” in the center. I don’t know if that make sense, Like I said I’m new and I know it but don’t know how to put it in words.
P.S I found out that you don’t need to construct a 4 points coordinate to paint, in my case, the “Star” on the center of the Canvas. You need just two to accomplish what I did, thank to Ofnuts.
(define (script-fu-create-a-Star)
(let* (
(imgWidht 700)
(ImgHeight 700)
(points (cons-array 2 'double) )
(img (car (gimp-image-new imgWidht ImgHeight RGB)))
(layer (car (gimp-layer-new img imgWidht ImgHeight RGB-IMAGE "Background" 100 LAYER-MODE-NORMAL)))
)
;Create the Background
(gimp-image-insert-layer img layer 0 0)
(gimp-context-set-foreground '(0 0 0))
(gimp-drawable-fill layer FILL-FOREGROUND)
(gimp-context-set-brush "2. Star")
(gimp-context-set-brush-size 210)
(gimp-context-set-brush-aspect-ratio 2)
(gimp-context-set-brush-angle 54)
(gimp-context-get-brush)
(gimp-context-set-foreground '(255 255 255))
(aset points 0 350)
(aset points 1 350)
(gimp-paintbrush-default layer 2 points)