Discuss Scratch

EvilCookie36
Scratcher
100+ posts

Mouse touching color?

Uhh nothing to say about this…
<mouse touching color []?>
terminator68
Scratcher
100+ posts

Mouse touching color?

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.
spgame05
Scratcher
100+ posts

Mouse touching color?

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
mouse touching color [#f0f]? :: sensing boolean
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.

Last edited by spgame05 (April 14, 2014 17:03:09)

EvilCookie36
Scratcher
100+ posts

Mouse touching color?

How did you make it blue?
terminator68
Scratcher
100+ posts

Mouse touching color?

EvilCookie36 wrote:

How did you make it blue?
Have you tried my method?
EvilCookie36
Scratcher
100+ posts

Mouse touching color?

terminator68 wrote:

EvilCookie36 wrote:

How did you make it blue?
Have you tried my method?
Yes, it worked, thanks.
22lokek
New 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.

I tried this method out, but it doesn't seem to work…
Bright-Idea
Scratcher
1000+ posts

Mouse touching color?

EvilCookie36 wrote:

How did you make it blue?
[scratchblocks]
<mouse touching color [] ? :: sensing>
[/scratchblocks]
makes
<mouse touching color [] ? :: sensing >

Last edited by Bright-Idea (Dec. 11, 2016 17:39:30)

Cub56
Scratcher
1000+ 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.
But if you move the mouse too fast sometimes the dot can't keep up. I've tried it sometimes and sometimes the dot moves slightly slower than the mouse.
WolfCat67
Scratcher
1000+ posts

Mouse touching color?

Cub56 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.
But if you move the mouse too fast sometimes the dot can't keep up. I've tried it sometimes and sometimes the dot moves slightly slower than the mouse.
That's why you use the custom blocks! Sure, it may still lag behind, but if you make it “Run Without Screen Refresh” it'll move a lot faster.
kenny2scratch
Scratcher
500+ posts

Mouse touching color?

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
mouse touching color []? :: sensing boolean
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.
This doesn't work across all sprites unless you do this in that sprite
when green flag clicked
forever
set [mouse touching red v] to <touching color [#FF0000]> // of course "mouse touching red" is a global variable
end
if <(mouse touching red) = [true]> :: control //in another sprite
do this
end
which still isn't a perfect solution because you can't sense different colors
mouse touching color [#ff0000] :: sensing boolean
mouse touching color [#0000ff] :: sensing boolean
mouse touching color [#ff00ff] :: sensing boolean
without making a separate variable for each color

Therefore, I give my support.
theonlygusti
Scratcher
1000+ posts

Mouse touching color?

Yep! Nice idea, totally support it
LordOfMuffins
Scratcher
100+ posts

Mouse touching color?

B U M P and S U P P O R T
FreddyFazbear2137
Scratcher
100+ posts

Mouse touching color?

kenny2scratch wrote:

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
mouse touching color []? :: sensing boolean
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.
This doesn't work across all sprites unless you do this in that sprite
when green flag clicked
forever
set [mouse touching red v] to <touching color [#FF0000]> // of course "mouse touching red" is a global variable
end
if <(mouse touching red) = [true]> :: control //in another sprite
do this
end
which still isn't a perfect solution because you can't sense different colors
mouse touching color [#ff0000] :: sensing boolean
mouse touching color [#0000ff] :: sensing boolean
mouse touching color [#ff00ff] :: sensing boolean
without making a separate variable for each color

Therefore, I give my support.

Omg like, IT DOESN'T WORK!
TheGreatMelon
Scratcher
100+ posts

Mouse touching color?

FreddyFazbear2137 wrote:

kenny2scratch wrote:

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
mouse touching color []? :: sensing boolean
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.
This doesn't work across all sprites unless you do this in that sprite
when green flag clicked
forever
set [mouse touching red v] to <touching color [#FF0000]> // of course "mouse touching red" is a global variable
end
if <(mouse touching red) = [true]> :: control //in another sprite
do this
end
which still isn't a perfect solution because you can't sense different colors
mouse touching color [#ff0000] :: sensing boolean
mouse touching color [#0000ff] :: sensing boolean
mouse touching color [#ff00ff] :: sensing boolean
without making a separate variable for each color

Therefore, I give my support.

Omg like, IT DOESN'T WORK!

I know this is kind of what I'm doing right now, but seriously please don't necropost
DaEpikDude
Scratcher
1000+ posts

Mouse touching color?

TheGreatMelon wrote:

FreddyFazbear2137 wrote:

kenny2scratch wrote:

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
mouse touching color []? :: sensing boolean
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.
This doesn't work across all sprites unless you do this in that sprite
when green flag clicked
forever
set [mouse touching red v] to <touching color [#FF0000]> // of course "mouse touching red" is a global variable
end
if <(mouse touching red) = [true]> :: control //in another sprite
do this
end
which still isn't a perfect solution because you can't sense different colors
mouse touching color [#ff0000] :: sensing boolean
mouse touching color [#0000ff] :: sensing boolean
mouse touching color [#ff00ff] :: sensing boolean
without making a separate variable for each color

Therefore, I give my support.

Omg like, IT DOESN'T WORK!

I know this is kind of what I'm doing right now, but seriously please don't necropost
(you can't necro in suggestions)
chexbox
Scratcher
100+ posts

Mouse touching color?

Hows this?
<[mouse v] touching color []?::sensing>
<[edge v] touching color []?::sensing>
<[sprite1 v] touching color []?::sensing>
Andrewoid7
Scratcher
17 posts

Mouse touching color?

<mouse touching color [] ? :: sensing>
FatChicken0707
Scratcher
2 posts

Mouse touching color?

FreddyFazbear2137 wrote:

kenny2scratch wrote:

terminator68 wrote:

EvilCookie36 wrote:

Uhh nothing to say about this…
mouse touching color []? :: sensing boolean
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.
This doesn't work across all sprites unless you do this in that sprite
when green flag clicked
forever
set [mouse touching red v] to <touching color [#FF0000]> // of course "mouse touching red" is a global variable
end
if <(mouse touching red) = [true]> :: control //in another sprite
do this
end
which still isn't a perfect solution because you can't sense different colors
mouse touching color [#ff0000] :: sensing boolean
mouse touching color [#0000ff] :: sensing boolean
mouse touching color [#ff00ff] :: sensing boolean
without making a separate variable for each color

Therefore, I give my support.

Omg like, IT DOESN'T WORK!
I dont understand. I am new to scratch, and am trying to make it so if my mouse is touching a color, then it will switch backgrounds
ACE009
Scratcher
100+ posts

Mouse touching color?

The true workaround is to use a broadcast and two variables:
...
set [hex code v] to [0x221133]
broadcast [mouse touching color v] and wait
if <(mouse touching color) = [true]> then
...
end

when I receive [mouse touching color v] // 1x1 pixel sprite
go to [mouse pointer v]
set [mouse touching color v] to <touching color (hex code)>

Powered by DjangoBB