Py5Shape.stroke_weight()
Contents
Py5Shape.stroke_weight()¶
Sets the width of the stroke used for lines and points in a Py5Shape
object.
Examples¶

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | def make_line(weight):
s = py5.create_shape()
s.begin_shape()
s.stroke_weight(weight)
s.vertex(20, 0)
s.vertex(80, 0)
s.end_shape()
return s
def setup():
py5.shape(make_line(1), 0, 20) # default
py5.shape(make_line(4), 0, 40)
py5.shape(make_line(10), 0, 70)
|
Description¶
Sets the width of the stroke used for lines and points in a Py5Shape
object. All widths are set in units of pixels.
This method can only be used within a Py5Shape.begin_shape() and Py5Shape.end_shape() pair.
Underlying Processing method: PShape.strokeWeight
Syntax¶
stroke_weight(weight: float, /) -> None
Parameters¶
weight: float - the weight (in pixels) of the stroke
Updated on November 12, 2021 11:30:58am UTC