How do I rotate the sprite cursor when is used on mouse?

Get help using Construct 2

Post » Tue May 02, 2017 6:19 pm

I have a sprite to be used as "set cursor from sprite" on start layout.

I tried adding a rotation bevaviour but the sprite not rotates.

How can i fix that?
B
27
S
10
G
3
Posts: 612
Reputation: 4,676

Post » Tue May 02, 2017 7:27 pm

Hi @matriax,

I couldn't find a way to make the sprite rotate once it had been set using the "set cursor from sprite" action, but I did manage this workaround, if it's of any use:

https://www.dropbox.com/s/0z9pg1z85fju5 ... .capx?dl=0
B
22
S
9
G
4
Posts: 479
Reputation: 4,333

Post » Tue May 02, 2017 7:55 pm

Yep, i already have that, using the MouseXY position have some lag, is not 100% precise.

BTW, thanks for the help! ;)
B
27
S
10
G
3
Posts: 612
Reputation: 4,676

Post » Tue May 02, 2017 8:30 pm

My guess is that the cursor uses css to change the appearance.
something like:
.custom {
cursor: url(images/my-cursor.png), auto;
}
And doing a search, there doesn't seem to be a way to rotate a cursor image using css, unfortunately.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Wed May 03, 2017 6:34 am

I found some way, is not desired but works.

Every tick > Set Sprite to cursor "MyImageCursor"

And in the cursor sprite add the animation frames of the rotation.

Will try to search to see if there is another way to hack it, maybe with some "execution javascript" ? mmm
B
27
S
10
G
3
Posts: 612
Reputation: 4,676

Post » Wed May 03, 2017 7:30 am

That's probably the way to do it, even from JavaScript.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Wed May 03, 2017 9:17 am

Ok thanks! ;)
B
27
S
10
G
3
Posts: 612
Reputation: 4,676


Return to How do I....?

Who is online

Users browsing this forum: hellokitty1, Julot135, newt and 28 guests