Load image from URL

Just started using Construct 2? Post your questions here

Post » Sun Feb 07, 2016 12:32 am

Hi!
I have one questiom about Sprite action "Load image from URL". Is this function just loading image from URL or it's downloading picture into memory and then showing it?

I need to know this. Let me explain why.
In my app user will hit BROWSE button and then screen will show with small thumbnail pictures that will be loaded from the server and when it clicks on one of the thumbnails Construct will start downloading this picture and then it will load that downloaded (bigger) picture into sprite.

There will be a lot of thumbnails, so i am afraid that my app will consume a lot of memory if " Load picture from URL" is downloading and then showing picture inside sprite.
B
14
S
3
G
1
Posts: 95
Reputation: 1,015

Post » Sun Feb 07, 2016 7:03 am

Both are the same. To be able to draw the image it has to be in memory.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Mon Feb 08, 2016 10:13 am

Yes, it is up to you whether you have separate thumbnails on your server for the thumbnails in your game, or if you want to just scale your large image as a thumbnail, but this will slow down the loading of your in-game "thumbnails".
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819

Post » Tue Feb 09, 2016 9:51 am

Yeah, i will use some JS libraries to resize picture on the server in order to create thumbnails
B
14
S
3
G
1
Posts: 95
Reputation: 1,015

Post » Tue Feb 09, 2016 1:08 pm

Perhaps you could write a page that returns an image when requested? e.g. /image.aspx?id=1&size=1 where size could signify whether it should return the full image or a thumbnail. It'd require some work outside of the Construct UI, but it's a tool that can be re-used in the future for other projects as well. That way you don't need to make a thumbnail of every image yourself and when you expand you could just toss new images into the folder and the page handles all the logic for you.
B
5
S
1
Posts: 43
Reputation: 461

Post » Thu Mar 10, 2016 4:32 am

@ButcherZV Are you using Load Image and is it working? I use it in a game I am developing and until a few days ago, it was working fine. It does not seem to be working anymore.
B
42
S
16
G
3
Posts: 169
Reputation: 4,383


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest