Hi Blinko
You need to :
- keep the point in an array
- calculate the distance between each points/dots
- draw the sprites for this distance likethat :
distance = 200 pixels (between dot[1] and dot[2])
your brush size = 20 px (width of the image)
so, you need to draw :
Number of dot = distance/brushsize
200 / 20 = 10 (for distance between dot[1]-dot[2])
You can add a paramater like "Spacing" (spacing in photoshop) to get a better stroke :
Number of dot = (distance / brushsize) * Spacing
(like the exemple on the image attached.)
Some functions which help :
- To knwo the distance between 2 points :
Function GetDistance(x,y,x1,y1)
dist = sqrt((x1-x)^2 + (y1-y)^2)
EndFunction dist
- the direction of the sprite between dot[1] and dot[2], like that (angle between 2 points) :
function GetAngle(x1#, y1#, x2#, y2#)
result# = ATanFull(x1# - x2#, y1# - y2#)
endfunction result#
I hope this help
.
AGK2 tier1 - http://www.dracaena-studio.com