Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how can i draw a circle using the pen addon insantly?
- dextertheidiot
-
Scratcher
18 posts
how can i draw a circle using the pen addon insantly?
how can i do this?
- dextertheidiot
-
Scratcher
18 posts
how can i draw a circle using the pen addon insantly?
Heres the project btw if anyone is wondering
https://scratch.mit.edu/projects/1070085492
Inside theres a draw circle script which can do what it needs to do… its just it doesnt draw it instantly.
https://scratch.mit.edu/projects/1070085492
Inside theres a draw circle script which can do what it needs to do… its just it doesnt draw it instantly.
- fswayne
-
Scratcher
4 posts
how can i draw a circle using the pen addon insantly?
To draw a circle instantly using the pen addon in Scratch, you can follow these steps:
Add the Pen extension to your project by clicking the “Add Extension” button at the bottom left of the Scratch editor and selecting “Pen”.
Create a script that uses the following blocks:
when green flag clicked
erase all
pen down
set pen size to (1)
set pen color to
repeat (360)
move (1) steps
turn right (1) degrees
Here's a breakdown of how this script works:
Circle Drawing Process
The script starts when the green flag is clicked.
It erases any previous drawings on the stage.
The pen is put down, ready to draw.
The pen size is set to 1 for a thin line, but you can adjust this as needed.
The pen color is set to red, but you can choose any color you prefer.
The key part is the repeat loop:
It repeats 360 times, representing the 360 degrees in a circle.
In each iteration, it moves 1 step and turns 1 degree to the right.
This creates a smooth circular motion, resulting in an instant circle
2
.
Customization Options
Size: To change the circle's size, adjust the number of steps in the “move” block. For example, “move (2) steps” will create a larger circle.
Color: You can change the pen color or even use the “change pen color by” block inside the loop to create a rainbow effect.
Speed: If you want to see the circle being drawn, you can add a small wait time inside the loop, like “wait (0.01) seconds”.
Efficiency Tip
For a faster drawing process, you can use fewer iterations with larger steps and turns:
text
repeat (90)
move (4) steps
turn right (4) degrees
end
This will create a circle with 90 sides, which will appear smooth and draw more quickly6.
Remember, you can experiment with different values to create various circular shapes and effects in Scratch using the pen addon.
Add the Pen extension to your project by clicking the “Add Extension” button at the bottom left of the Scratch editor and selecting “Pen”.
Create a script that uses the following blocks:
when green flag clicked
erase all
pen down
set pen size to (1)
set pen color to
repeat (360)
move (1) steps
turn right (1) degrees
Here's a breakdown of how this script works:
Circle Drawing Process
The script starts when the green flag is clicked.
It erases any previous drawings on the stage.
The pen is put down, ready to draw.
The pen size is set to 1 for a thin line, but you can adjust this as needed.
The pen color is set to red, but you can choose any color you prefer.
The key part is the repeat loop:
It repeats 360 times, representing the 360 degrees in a circle.
In each iteration, it moves 1 step and turns 1 degree to the right.
This creates a smooth circular motion, resulting in an instant circle
2
.
Customization Options
Size: To change the circle's size, adjust the number of steps in the “move” block. For example, “move (2) steps” will create a larger circle.
Color: You can change the pen color or even use the “change pen color by” block inside the loop to create a rainbow effect.
Speed: If you want to see the circle being drawn, you can add a small wait time inside the loop, like “wait (0.01) seconds”.
Efficiency Tip
For a faster drawing process, you can use fewer iterations with larger steps and turns:
text
repeat (90)
move (4) steps
turn right (4) degrees
end
This will create a circle with 90 sides, which will appear smooth and draw more quickly6.
Remember, you can experiment with different values to create various circular shapes and effects in Scratch using the pen addon.
- deck26
-
Scratcher
1000+ posts
how can i draw a circle using the pen addon insantly?
You need to use the ‘no screen refresh’ option for the custom block to get instant drawing. Right click on the header block, chooe Edit and tick the box.
- pikachuuaauuaa
-
Scratcher
9 posts
how can i draw a circle using the pen addon insantly?
you can use use screen refresh in custom blocks or if you want it to show the circle drawing for everyone else and just want instant drawing for while you work on it you can hold shift and press the green flag for turbo mode, hope this helps
Last edited by pikachuuaauuaa (Oct. 4, 2024 16:50:22)
- bsteichman
-
Scratcher
500+ posts
how can i draw a circle using the pen addon insantly?
set pen color to [#00AFFF]
set pen size to (size)
pen down
pen up
change pen size by (-2)
set pen color to [#FFFFFF]
pen down
pen up
- GamesReinvented
-
New Scratcher
100+ posts
how can i draw a circle using the pen addon insantly?
this wouldn't work in a variety of scenarios, such as when the background isn't white, is multicolored, or if you're drawing a circle over anything else, which is why we have the scripts that use trigonometry shown above.set pen color to [#00AFFF]
set pen size to (size)
pen down
pen up
change pen size by (-2)
set pen color to [#FFFFFF]
pen down
pen up
- bsteichman
-
Scratcher
500+ posts
how can i draw a circle using the pen addon insantly?
i know, but it appears to work with the specific scenario that he has, ofcthis wouldn't work in a variety of scenarios, such as when the background isn't white, is multicolored, or if you're drawing a circle over anything else, which is why we have the scripts that use trigonometry shown above.set pen color to [#00AFFF]
set pen size to (size)
pen down
pen up
change pen size by (-2)
set pen color to [#FFFFFF]
pen down
pen up
define circleworks too as a more general circle drawer
erase all::pen
set [angle v] to [0]
repeat (360)
go to x: ((size::variables) * ([cos v] of (angle))) y: ((size::variables) * ([sin v] of (angle))
pen down
change [angle v] by (1)
end
- dextertheidiot
-
Scratcher
18 posts
how can i draw a circle using the pen addon insantly?
Note: i forgot to enable run without screen refresh, sorry!
I dont need any help anymore
I dont need any help anymore
Last edited by dextertheidiot (Oct. 9, 2024 14:54:07)
- MillionOfficial
-
Scratcher
500+ posts
how can i draw a circle using the pen addon insantly?
Here is a solution without custom blocks:
set pen size to (circle size :: grey)
pen down
wait (0) secs
pen up
- Discussion Forums
- » Help with Scripts
-
» how can i draw a circle using the pen addon insantly?






