Discuss Scratch

starlightsparker
Scratcher
1000+ posts

need help with pen

okay I’m making a project where you can draw. when you start, it’s normal and you can draw but once you go to menu, click color and change the color, then close the menu, it doesn’t draw anymore. can someone help?
https://scratch.mit.edu/projects/1054365731/

Last edited by starlightsparker (Aug. 10, 2024 08:43:55)

MeyseyH
Scratcher
65 posts

need help with pen

I think I see the problem.
I could draw easily after starting the project but when the menu was closed I could still draw but not with the colour I had selected.
starlightsparker
Scratcher
1000+ posts

need help with pen

MeyseyH wrote:

I think I see the problem.
I could draw easily after starting the project but when the menu was closed I could still draw but not with the colour I had selected.
..so how do I fix it?

Last edited by starlightsparker (Aug. 10, 2024 08:45:43)

MeyseyH
Scratcher
65 posts

need help with pen

The reason it doesn't work is because in the preview, you are using the Colour Effect blocks and in the pen you are using the Pen Colour blocks.
The pen and the sprites use different colour schemes so for example, 50 in Colour Effect is Green and in Pen Colour it's Blue.
The way to fix this is to draw the preview instead of using a sprite. That way they will match up.
You can do this easily with this code:

forever
if <[menu open] = [yes]> then
set pen colour to (colour!!)
set pen size to 30
pen down
else
set pen colour to white.
pen up
end
end
you would need an hidden sprite to draw it but it would solve the problem,
starlightsparker
Scratcher
1000+ posts

need help with pen

MeyseyH wrote:

The reason it doesn't work is because in the preview, you are using the Colour Effect blocks and in the pen you are using the Pen Colour blocks.
The pen and the sprites use different colour schemes so for example, 50 in Colour Effect is Green and in Pen Colour it's Blue.
The way to fix this is to draw the preview instead of using a sprite. That way they will match up.
You can do this easily with this code:

forever
if <[menu open] = [yes]> then
set pen colour to (colour!!)
set pen size to 30
pen down
else
set pen colour to white.
pen up
end
end
you would need an hidden sprite to draw it but it would solve the problem,
I tried making the preview with the pen but there’s an issue. The hide block does not hide the pen used in the sprite, and the erase all block applies to the pen used in all the sprites, not just one so it would erase the pen used in the drawing sprite as well I think. So how am I supposed to make it so that the preview disappears when you close the menu?

Last edited by starlightsparker (Aug. 10, 2024 09:00:46)

MeyseyH
Scratcher
65 posts

need help with pen

You would have to redraw the preview shape but in white, although that would clear any drawings behind it
starlightsparker
Scratcher
1000+ posts

need help with pen

MeyseyH wrote:

You would have to redraw the preview shape but in white, although that would clear any drawings behind it
That’s the issue, I don’t want it to erase the other stuff. I wanna keep the drawings made by the pen sprite, but not the ones made by the preview sprite when the menu is closed.

Last edited by starlightsparker (Aug. 10, 2024 17:28:01)

SpyCoderX
Scratcher
1000+ posts

need help with pen

The issue is that brightness is 0. You just need to make it 100.
starlightsparker
Scratcher
1000+ posts

need help with pen

SpyCoderX wrote:

The issue is that brightness is 0. You just need to make it 100.
I got that but I have a new problem.
Go to the menu, and click color. It will draw a red circle for preview.
The issue is, once it’s drawn, the blocks for color will affect new drawings but not the circle that’s already shown. So how do I make the preview?
Another issue about the preview, the erase all block erases the pen used in other sprites too so I won’t use that to hide the preview when the menu is closed, and the hide block doesn’t affect the pen. What I did was make it draw an identical circle in the same color as the background, but then the drawing pen sprite (not the preview sprite) can’t draw over the preview sprite’s circle even if the drawing pen sprite is on the top layer.

Last edited by starlightsparker (Aug. 10, 2024 18:09:28)

SpyCoderTest
Scratcher
57 posts

need help with pen

I made this: https://scratch.mit.edu/projects/1054506823/
You can just backpack it.

It should work fine (a bit stuttery on the saturation slider, but its really small compared to being able to show it on top of pen )
SpyCoderTest
Scratcher
57 posts

need help with pen

SpyCoderTest wrote:

I made this: https://scratch.mit.edu/projects/1054506823/
You can just backpack it.

It should work fine (a bit stuttery on the saturation slider, but its really small compared to being able to show it on top of pen )
Just doubled the number of costumes to remove that.
starlightsparker
Scratcher
1000+ posts

need help with pen

SpyCoderTest wrote:

I made this: https://scratch.mit.edu/projects/1054506823/
You can just backpack it.

It should work fine (a bit stuttery on the saturation slider, but its really small compared to being able to show it on top of pen )
thank you so much!

Powered by DjangoBB