Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

[Scripting] On Mouse Touch

LTN Games

Master Mind
Resource Team
Xy$
0.01
Is there an option for checking if the mouse is over top of a sprite? I'm want to create a button and I want to change the image when the mouse is over top of it but I can't find any function in MV to check such a thing.
Any help would be appreciated, thanks (cheeky)
 

JibstaMan

Towns Guard
Xy$
0.00
I don't know much (read: anything) about the core just yet. I can imagine this functionality isn't in there anyway. You could maybe use onmousemove bound to the document?

Apparently, I'm incapable of letting people figure things out for themselves with me just giving advice... so here's a JSFiddle.
 

Boy Who Codes

Praised Adventurer
Xy$
0.00
I believe there's no way to do this not unless the mouse is using a sprite to indicate where it is. However, you can use the x and y values of the TouchInput. You can also try to use an invisible sprite that follows the mouse and check whether the invisible sprite collides with the button, and when it does, change the sprite.
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
Alright, thank you both, I will look into both of these possible solutions and report back, I've never used TouchInput, so I may ask some questions about that. I also never used the document function, so this shall be fun, I'll be back.
 
Last edited:

LTN Games

Master Mind
Resource Team
Xy$
0.01
I've been so busy I still never tried ay of these solutions, I should be able to sometime today. However I did have time to go through Mouse System Ex and it looks like he re-writes onMouseMove function specifically for rollover events, I'm sure I could make it work to work with images rather easily. I'll see what I can do if I get time later on. Thanks again everyone (cool)
 
Top