This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-02-26 18:20:19

bfabian2012
New Scratcher
Registered: 2013-02-26
Posts: 2

Sprite changes color when mouse hovers

Hi,
I want to make my activity so that when the mouse touches a Sprite (button) it will change color. This would not require a mouse click, just for the cursor to touch the Sprite. Is that possible in Scratch and if so what is the code? Thanks!

Offline

 

#2 2013-02-26 19:09:18

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Sprite changes color when mouse hovers

Yes, it's very possible.  smile

So, rather than explain, i will just show you:

when gf clicked
forever
if <touching? [mouse pointer v]>
switch to costume [mouse_Over v] // You could use color effect*
end
if <not <touching? [mouse pointer v]> >
switch to costume [normal v]
end
end

*You could use color effect, but i find that really confusing and it's really only good for constantly changing the color of something.


Hope that helps,

CAA14

Last edited by CAA14 (2013-02-26 19:09:49)

Offline

 

#3 2013-03-04 14:54:22

bfabian06
New Scratcher
Registered: 2013-02-27
Posts: 1

Re: Sprite changes color when mouse hovers

Thanks so much. That sounds easy. I will give it a try.
bfabian06

Offline

 

#4 2013-03-04 15:03:57

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Sprite changes color when mouse hovers

Here's a tutorial on how to do this.

Offline

 

Board footer