Issue with using images for mouse cursor animation

Get help using Construct 2

Post » Fri Jul 31, 2015 6:58 pm

In my game I am using a sprite with two frames and an animation which I use to make the cursor animated. The code to load the image and
animate the cursor is the following:

Sprite.Stop Animation
Sprite.Set Animation Frame to 0
Sprite.Load Image from "image1.png"
Sprite.Set Animation Frame to 1
Sprite.Load Image from "image2.png"
Sprite.Start Animation from beginning

->Sprite.On Frame Changed : Mouse.Set Cursor from Sprite

What I can't understand is why this works in some cases (the cursor is animated) and not in others. It seems to depend on the image files I use,
yet these are all small in size and 32x32 pixels or less. If I display the Sprite on the canvas, I can see it animated in all cases, but the mouse's cursor only shows
the animation in some cases.

Is this a bug or am I missing something?
B
10
S
3
Posts: 87
Reputation: 957

Post » Sat Aug 01, 2015 10:51 am

Message: wmsgva can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
After reflecting on the issue, I though the problem may be with loading the images, so I modified code to ensure they're loaded, but the problem remains.

See the example Capx here: www.dropbox.com/s/ilpiesz9r0zkfsu/Cursortest.capx?dl=0

If you run this Capx, you will notice that the sprite displayed on the layout for test purposes is animated, but not the mouse cursor. If you edit the code to replace "action1.png" and "action2.png" with "press1.png" and "press2.png", you will notice that the cursor does animate properly with these other images.

Any insights into why this is happening would be welcome.
B
10
S
3
Posts: 87
Reputation: 957

Post » Sat Aug 01, 2015 11:07 am

For me it seems to work on firefox and nw.js..
Not on google chrome, internet explorer and edge..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Aug 01, 2015 11:29 am

A little trick for chrome...

Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sat Aug 01, 2015 3:22 pm

@Korbaach Thank you for the tip, it now works fine in Chrome. Will report as a bug.
B
10
S
3
Posts: 87
Reputation: 957


Return to How do I....?

Who is online

Users browsing this forum: draiza and 7 guests