Issue with using images for mouse cursor animation

  • 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?

  • 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:

    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.

  • For me it seems to work on firefox and nw.js..

    Not on google chrome, internet explorer and edge..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • A little trick for chrome...

  • korbaach Thank you for the tip, it now works fine in Chrome. Will report as a bug.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)