How do I preload HTMLElement/external file images?

0 favourites
  • 4 posts
From the Asset Store
500 monsters and creatures images for card games - Set 1
  • Is there a way to preload these images? When using the HTML element, I often notice a delay when loading the image for the first time. I read in the forum that adding to the offline.json should do the trick. I checked it, and my images are on there. Yet for some reason, there's still a delay.

    You'll see this in action in my game WatchTrader:

    construct.net/en/free-online-games/watch-trader-41994/play

    When you load the game, the logo sometimes gets delayed. Or when you first see the watches in the main screen table, they take a moment to load.

  • Anyone? I've tried requesting the files with Ajax, but even on completion, there's still a delay or flicker on the first load. Ideally I would like this to be included in the initial game preloader. Is there no way and do I just resort to preloading with css/javascript?

  • I'm not sure this is related, but images are not removed from memory in between two layouts that both use the same object. So you should be able to use an intermediate loading layout with minimal content and events that load in your external files, then switch to your main layout when it's done.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the suggestion. Makes sense if that's the case. I just ended up doing a simple css workaround to preload the images. Works in my case since I only have a few images. Might not go so well with bigger projects, so your solution is better. Will try and test it one of these days.

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