How do I reload url image and receive new fresh data?

0 favourites
  • 3 posts
From the Asset Store
Addition, subtraction and multiplication are supported. Endless replayability.
  • I have a sprite.

    I load image from url, "1.png".

    ...Some time passes... (and the image on the server has been replaced by another.)

    Same event runs again, load from url, "1.png".

    But the sprites image does not update. (restart of layout does not solve, but stop/start new preview does.)

    I have tried to destroy all sprites,wait a few ticks, and unload all images from memory.

    The sprite however is a template from a (unloaded)repository layout.

    The .htaccess on the server providing the png has no cache settings.

    any ideas?

  • If the image name is the same it will not load.

    add a suffix to the end of the name.

    example

    yoururl.com/image.png?1

    yoururl.com/image.png?2

    yoururl.com/image.png?3

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If the image name is the same it will not load.

    add a suffix to the end of the name.

    example

    yoururl.com/image.png?1

    yoururl.com/image.png?2

    yoururl.com/image.png?3

    Such a simple solution, I've been struggling for quite a while now.

    Thank you my friend!

    Added a global variable called suffix that increases with every load.

    I take it the cache problem goes away with every restart and there will be no problem reusing suffix between runs. (?)

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