How do I restore original sprite image?

0 favourites
  • 9 posts
From the Asset Store
500 monsters and creatures images for card games - Set 1
  • If I use "Load image from URL" action to replace an image in a sprite, is it possible to revert it back to the original image?

    I tried destroying the sprite, unloading it from memory, creating again, but it gets created with a new image.

  • Its layout by layout loading, so no.

    Best suggestion would be to stick it into storage using the binary plug.

  • The sprite is defined on another "storage" layout.

    I create it in runtime, replace an image in one of the frames. Then destroy, unload from memory, wait, create again. And yet the replaced image is still there..

    To store an image with BinaryData I will need to paste it to DrawingCanvas first, right? This will be a really complex solution, since I have lots of sprites with many frames each.

  • There's other options like duplicate it as another object, or use a different object type that doesn't have the image restrictions like Tiled Bg, or Drawing Canvas.

  • Ashley , could you please explain why this happens? I wonder if it's a bug or expected behavior?

    If I destroy all instances of the sprite and unload it from memory, I thought that next time I create this sprite, its images should be re-loaded from the spritesheet.

  • To avoid wasting loads of memory, all instances of an object type share the same set of animations and animation frames.

    Loading a URL permanently overwrites the animation frame it's loaded in to.

    If you want to keep around the original, load the URL in to a separate placeholder object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Loading a URL permanently overwrites the animation frame it's loaded in to.

    So this updated URL is still kept somewhere, even when there are no instances left and the sprite is unloaded from memory?

  • The animations and animation frames belong to the object type, and object types are global to the project. It has nothing to do with how many instances exist.

  • Oh, I see, thank you!

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