Change mouse cursor

Get help using Construct 2

Post » Thu Apr 18, 2013 8:21 am

you can set a global variable for mouseover and then a button click for your building and set the global variable to 1. and when ever its set to 1 by using cursor is over building and inverting it you can change the type of cursors by setting them from sprite and also setting that sprite's x, y coordinate to the mouse and choose another mouse button like the right button when ever clicked it changes back the mouse cursor to the usual one you have along with setting the building cursor to lout of layout or something. i hope it helped you, otherwise i can send you a little demonstration with the help of a construct file..there might be other simple ways to do it but i figured this out for my own game..
Udain Tomar
Game Designer
B
6
S
1
Posts: 34
Reputation: 695

Post » Fri Dec 27, 2013 2:58 pm

I found this post and it helped me discover a new solution to the same issue.

I think that there's a new functionality on Construct that may aid.
You can now use the following logic:

When Mouse Cursor is over "Object 1" -> Mouse Set Cursor to "Hand"

If you don't want your mouse stuck as a hand then you must add an inverse condition:

When Mouse Cursor is Over "Background" AND Mouse cursor is NOT over "Object 1" -> Mouse Set Cursor to "Normal"
B
12
S
3
Posts: 51
Reputation: 1,278

Post » Sat May 21, 2016 12:23 am

Just set Mouse: set cursor to None, and then have a sprite follow your mouse.x and mouse.y every tick.
B
9
S
1
Posts: 33
Reputation: 612

Post » Fri Dec 30, 2016 5:41 pm

So if you are trying to set your mouse cursor to a sprite right now you may be running into issues with it on IE & Chrome. It may not let you or only let you set it once, along with that you may want your mouse cursor to be animated and treated better as a object with properties a mouse might not be able to give.

First things first create your mouse cursor image.


Then once you have that made you will need to import it into construct 2 as a sprite object.



Load the image where ever you have saved it into the actual sprite object, if you have it animated you will want to look at the animation bar at the bottom and import them that way by right clicking and by file, or just manually adding each frame of animation.

You will of course need to import the construct 2 mouse plugin object into your project some where

Next thing you will need to do is create a on start of layout event, in that event you need set the mouse cursor style to None.

Then after that you need to have it create your mouse image sprite object on the top layer x = mouse.x: y = mouse.y.

The final step is to have it always update to the mouse's position. So you create a on every tick event, and in it you create a action to set position of your sprite object to mouse.x & mouse.y

l
B
7
S
2
Posts: 6
Reputation: 577

Post » Sat Dec 31, 2016 2:57 am

"5 years later" thanks guys! :D
B
16
S
4
G
2
Posts: 46
Reputation: 2,104

Previous

Return to How do I....?

Who is online

Users browsing this forum: max2612 and 11 guests