Next you will add code to allow the person using your program to draw things with different pen widths.
First, add a new variable called width
.
Add this line inside the forever
loop of the pencil sprite’s code:
The pen width now repeatedly gets set to the value of the width
variable.
Right-click on the
variable displayed on the Stage, and then click on slider.width
You can now drag the slider that is visible below the variable to change the variable’s value.
Test your project and see if you can change the pen width.