Discuss Scratch

qloakonscratch
Scratcher
1000+ posts

Mouse touching color?

The owner hasn't spoken on this topic for a long time (like a really long time, 7 years in fact), so if you want, you can switch to a different, more recent topic here. I'm reporting this topic to be closed.
cs4433716
Scratcher
3 posts

Mouse touching color?

how do we do this in the current scratch version? i don't understnad
JerryDaGamer
Scratcher
18 posts

Mouse touching color?

…Too soon to say hello because of necroposting?
zainalzu
Scratcher
1 post

Mouse touching color?

My browser / operating system: Mac

OS Macintosh X 10.15.7, Chrome 98.0.4758.109, No Flash version detected
AusomeGamer456
Scratcher
44 posts

Mouse touching color?

Yeah, I've always wanted a feature like this! I do have a way around it though, and I used this in my new project called Mini Projects.

Make a hitbox around the size of the mouse pointer, then put this code in the hitbox:

when green flag clicked
hide
forever
go to [mouse pointer]
end

when green flag clicked
forever
wait until <touching color [...] ?>
Your function
end

Hope this helps!
joel360lol
Scratcher
2 posts

Mouse touching color?

move (11) steps[scratchblocks]
when green flag clicked
[/scratchblocks]

Last edited by joel360lol (March 26, 2022 16:04:08)

EDGE_X
Scratcher
100+ posts

Mouse touching color?

While the workaround for it is easy, I totally support. This would make for a lot of interesting mazes.
Rainbow_Yogurt123
Scratcher
2 posts

Mouse touching color?

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
<mouse touching color []?>
You can find a way around that.

First, make a sprite that is just a 1x1 black dot. Set the ghost effect to 99%, and tell it to always go to the mouse pointer. Then, just use that sprite for color detection.

wow! thats smart! i never thought of that
thx!
reallysoftuser
Scratcher
1000+ posts

Mouse touching color?

This is useful for reducing the amount of work needed to do such a simple function. A workaround isn't always a solution, so a block would be ideal for this. It's not ideal the fact you need to make an entire new sprite to track the color your mouse pointer is touching. Minimizing work and making programming easier is a design goal of Scratch.
MCRBLX
Scratcher
1 post

Mouse touching color?

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
<mouse touching color []?>
You can find a way around that.

First, make a sprite that is just a 1x1 black dot. Set the ghost effect to 99%, and tell it to always go to the mouse pointer. Then, just use that sprite for color detection.


Why 99% can't you do 100%?
-Valtren-
Scratcher
1000+ posts

Mouse touching color?

MCRBLX wrote:

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
<mouse touching color []?>
You can find a way around that.

First, make a sprite that is just a 1x1 black dot. Set the ghost effect to 99%, and tell it to always go to the mouse pointer. Then, just use that sprite for color detection.


Why 99% can't you do 100%?
it wont' detect. anyway they're pretty much the same
red_hunt12
Scratcher
3 posts

Mouse touching color?

scratchblocks]
<mouse touching color ? :: sensing>
red_hunt12
Scratcher
3 posts

Mouse touching color?

<mouse touching color [#2353bd] ?>
minecraft_edit
Scratcher
9 posts

Mouse touching color?

I just found out that it’s way easier in Snap!
wvzack
Scratcher
500+ posts

Mouse touching color?

support
gdfsgdfsgdfg
Scratcher
1000+ posts

Mouse touching color?

wvzack wrote:

support

give a reason why
amongusinreallife881
Scratcher
4 posts

Mouse touching color?

when green flag clicked
forever
set [? v] to []
end
INSERT-USER_NAME
Scratcher
1000+ posts

Mouse touching color?

I think the workaround to this is fairly simple, it can kind of only be used in one sprite though.
astro_code1
Scratcher
100+ posts

Mouse touching color?

No support. They could detect when you heart and starred, and make a project only playable if you get a certain amount of hearts and stars.
The_Game_
Scratcher
1000+ posts

Mouse touching color?

astro_code1 wrote:

No support. They could detect when you heart and starred, and make a project only playable if you get a certain amount of hearts and stars.
How does letting you detect what colour the mouse pointer is touching allow for this???

Powered by DjangoBB