Pen
Description
The pen commands allow you to draw various types of lines on the screen. The pen can be configured with different properties like size, opacity, and brightness.
Pen Commands
Pen State
pen "down"
// Start drawing - subsequent movements will create lines
pen "up"
// Stop drawing - subsequent movements won't create lines
Pen Properties
pen "size" 3
// Set line thickness in pixels
pen "opacity" 75
// Set line opacity (0-100)
pen "brightness" 100
// Set line brightness (0-100)
Line Drawing Commands
Basic Line
Draws a straight line between two points.
c #fff
pen "size" 3
// Set color and line thickness
goto 0 0
line 50 0 -50 -50
// Draws a line from (50,0) to (-50,-50)
Dotted Line
Creates a line made up of evenly spaced dots.
c #fff
pen "size" 3
// Set color and dot size
goto 0 0
dots -100 -100 100 100 30
// Parameters: startX startY endX endY numberOfDots
Striped Line
Creates a dashed line with configurable segment length and spacing.
c #fff
pen "size" 3
// Set color and line thickness
goto 0 0
stripe -100 100 100 -100 10 5
// Parameters: startX startY endX endY numberOfSegments gapSize
Command Reference
line x1 y1 x2 y2
Draws a solid line from point (x1,y1) to (x2,y2)
dots x1 y1 x2 y2 count
Draws a dotted line from (x1,y1) to (x2,y2) with specified number of dots
stripe x1 y1 x2 y2 segments gap
Draws a dashed line from (x1,y1) to (x2,y2) with specified number of segments and gap size
Important Notes
Always set color (
c
) and pen size before drawingUse
goto
to position the pen before drawingPen properties (size, opacity, brightness) affect all subsequent drawing operations
The coordinate system is centered (0,0 is in the middle of the window)
Positive Y is up, negative Y is down
Import "win-buttons" to show window controls when needed
Last updated
Was this helpful?