how to load a new animation into a sprite via URL

0 favourites
  • 10 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • Good morning guys, I'm trying to load a new animation in a Sprite using a URL to be able to change this animation whenever I want... it's to be able to have a character with different skins. But when I try to load the image into the sprite of the webp file, it only puts the first image and not the full animation. How I could do it is very important for my project.

  • You can only upload the first frame.

  • It is very necessary to be able to replace a complete animation with a webp sprite... because in this way the possibilities and GPU memory control are more precise without having to overload the system.

    I think the animation override functions are very necessary in Construct3

  • You can make a feature request.

    In the meantime, the currently available way to do this is to break out your source animation into individual files per frame, and loop through to load each frame into your animation via load from url.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can make a feature request.

    In the meantime, the currently available way to do this is to break out your source animation into individual files per frame, and loop through to load each frame into your animation via load from url.

    hi, could you post an example of how to make it with the loop?

  • Repeat sprite.animationframecount times

    -> Sprite - Load image from URL "imagename"&loopindex&".filetype"

    Where the frame number is appended to the image/animation name eg. sprite0.png, sprite1.png, sprite2.png, and so on.

  • Repeat sprite.animationframecount times

    -> Sprite - Load image from URL "imagename"&loopindex&".filetype"

    Where the frame number is appended to the image/animation name eg. sprite0.png, sprite1.png, sprite2.png, and so on.

    Thanks, how can I manage the animation speed? Instead of the loop I could use a variable that changes number every x seconds, but maybe there is a better method?

  • One example please…

  • What? No, load the entire animation into memory before playing it.

    Also I forgot load from url is an asynchronous action, so it won't work in a loop. Use an incrementing variable instead, and the on load successful trigger condition to add 1 to the variable and load the next frame.

  • Using variables at the end of the animation you can reset the value of the variable to 0 to create a loop XD

    Do you think it might make sense to animate an entire game with this type of animation? Or could it have some negative feedback?

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