Load frames from external folder

Get help using Construct 2

Post » Wed Oct 09, 2013 6:36 pm

Hey guys,

I have looked forum but I could'nt find a way for this.
Is there a way to load frames from external folder to a sprite
or
load images as a sprite from a folder ?

Actually, I want to make a game that when you press a button game will get a random image from an external folder and show it to user.

Thanks.


Image
B
64
S
28
G
39
Posts: 460
Reputation: 24,212

Post » Wed Oct 09, 2013 8:25 pm

Yes. Sprites have a load image from file action.
B
46
S
14
G
7
Posts: 603
Reputation: 8,116

Post » Thu Oct 10, 2013 5:19 pm

@EncryptedCow I can't find this action, there is a load image from url action but I tried it and it seems it won't work for me.
Image
B
64
S
28
G
39
Posts: 460
Reputation: 24,212

Post » Fri Oct 11, 2013 10:00 am

I don't know Construct very well and I would be happy to learn another way to do it.
I would import all my images in the game and then use "Load from an URL". This command has not a clear name but it works with imported images : you just have to give the name of an imported image and it is loaded.
It is not exactly what you want but it's the closest way I can find.
B
5
S
2
G
1
Posts: 6
Reputation: 1,144

Post » Fri Oct 11, 2013 12:15 pm

@bilgekaan
Last time I tried this it worked like this.

Load image from URL -> NodeWebkit.AppFolder & "images/image.png"

But only when exported.
B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Post » Fri Oct 11, 2013 1:36 pm

Images must be included in the project Files folder first in order to be imported at runtime. once you have done that, you don't even need to provide an absolute URL to the action, just the filename.
The new image will replace the current frame of animation. So in order to load a whole animation dynamically, you must first create an empty sprite in your project, with a set number of blank frames. Then you must load each frame one by one with the Load image from URL action. But you must make sure to go to the next animation frame between each loading action, using the Set Frame action, or each new image will keep overwriting the same frame
B
12
S
5
G
2
Posts: 132
Reputation: 2,627

Post » Fri Oct 11, 2013 2:32 pm

Apparently my answer didn't post last time. If you use load from URL you can input the images file-name and it will load from project files.
B
46
S
14
G
7
Posts: 603
Reputation: 8,116


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests