Dynamic loading of sprites

Discussion and feedback on Construct 2

Post » Fri Aug 09, 2013 5:56 pm

Hello,

similar topics had been discussed already but the answers were not clear according to dynamic loading of sprite stripes.

I just want to know if I understood right. As far as i understood the data of the images of the whole project will be transfered from the webserver to the browser, when i call the index.html of the game. It is not possible to transfer image data (i would need sprite stripes) from the webserve to the browser only when the affected layer is started. Is that right?

The already discussed "layout by layout loading" is only about transfering data from already downloaded data into the browsers memory. Is that right?

This question ist just for clarification so i have to accept this matter for my game.

Thanks in advance.
B
4
Posts: 3
Reputation: 681

Post » Fri Aug 09, 2013 6:13 pm

Yes, you're correct in your understanding.

You've got one other option, and that's to do it manually using the Sprite -> Load image from URL action. The idea here is that you use dummy or low-res images as the sprite images, and then, as necessary, load their high-res versions (probably pre-load it in the preceding layout). These high-res versions can be stored in the project folder and retrieved with a relative URL.

Here's an example of it in action, and here's the capx. It's set to change at 1 second just to make it noticeable on high-speed connections. It'll sit in the browser's cache once it's downloaded.

The only real caveat is that you don't have much control over this system, other than creating a very laborious, or very smart, chain of On image URL loaded conditions to ensure the player can't continue until everything is loaded.GeometriX2013-08-09 18:13:48
B
57
S
15
G
11
Posts: 912
Reputation: 12,581

Post » Fri Aug 09, 2013 6:44 pm

Thanks for clearing this up.

This was really helpful.
B
4
Posts: 3
Reputation: 681


Return to Construct 2 General

Who is online

Users browsing this forum: sayali ghule and 6 guests