-
Notifications
You must be signed in to change notification settings - Fork 2
Shape Functions
Below are the current set of basic shape functions in genartlayers.
~Note that the units for location (x,y) and dimensions (width, height, radius) are normalized to the artBoard dimensions. For example, x=0.5, y=0.5 will place a shape in the middle of the artBoard.
~fillMode is a value 0 (for fill) or 1 (for stroke)
~Ranges for color values are as follows...
Hue: 0-359
Saturation: 0-100
Lightness: 0-100
Alpha: 0-255
drawRect(x, y, width, height, lineWidth, hue, saturation, lightness, alpha, fillMode)drawCircle(x, y, radius, lineWidth, hue, saturation, lightness, alpha, fillMode)drawEllipse(x, y, radX, radY, rotation, lineWidth, hue, sat, lit, alpha, fillMode)rotation is in radians.
drawPath(path, lineWidth, hue, saturation, lightness, alpha, fillMode, close)close is a 0 or 1 value, 1 being close and 0 being do not close.
path is of the form [ [x1,y1], [x2,y2], ... , [xN,yN] ]
drawArc(x, y, radX, radY, rotation, startAngle, endAngle, lineWidth, hue, sat, lit, alpha, fillMode) rotation, startAngle, and endAngle are in radians.
drawText(text, x, y, fontSize, hue, sat, lit)fontSize is in normalized units.
drawTextPix(text, x, y, fontSizePix, hue, sat, lit)fontSize is in pixels (px).
Please feel free to DM me on @genartlayers on Instagram at any time if you have questions, you spot a bug, you have a feature request, etc. I am here to help!
-Brian