Reference for add_line_to
Add a straight line to a shape. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
add_line_to
Sound (future)
Style
System
Text
Transform
Purpose
Draw a straight line from the current position to a new destination which is used as the next "current" position.
Snippet
Draw a shape which consists of a single line from x of 50 and y of 100 to x of 150 and y of 200.
shape = sketch.start_shape(50, 100) shape.add_line_to(150, 200) shape.end() sketch.draw_shape(shape)
Parameters
- x: The x coordinate to which the line should be drawn.
- y: The y coordinate to which the line should be drawn.
Examples
Availability
Available for all platforms.