How do I show an image chosen with File Chooser.

Get help using Construct 2

Post » Thu Feb 19, 2015 11:50 am

I'm guessing this is probably a really 'noob' question, but for the life of me, I can't get C2 to get it to work. What I basically want to be able to do is choose a file (in my case an image) with 'File Chooser' and then have it show up as an image for a sprite object.

I've done a bit of research and seen that I should be able to do it with 'Load image from URL' and something about "blob:", but then it calles for a unique ID and I have NO IDEA what to use/do. I'm assuming this is just because I'm a total dunce and rookie with C2, so any help would be greatly appreciated!

Thanks!
B
10
S
1
Posts: 72
Reputation: 1,016

Post » Thu Mar 05, 2015 3:41 pm

GideonG ,excuse mi english. I have the same problem. I can not find the way to the loaded image is immediately visible . Have you found a solution? regards
B
4
S
1
Posts: 2
Reputation: 679

Post » Thu Mar 05, 2015 4:40 pm

GideonG, i have a solution.
Screenshot_1.jpg
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 2
Reputation: 679

Post » Thu Mar 05, 2015 6:09 pm

Try like this ... Works for me :):
You do not have the required permissions to view the files attached to this post.
B
31
S
7
G
4
Posts: 387
Reputation: 4,544

Post » Thu Mar 05, 2015 9:16 pm

Try this demo
You do not have the required permissions to view the files attached to this post.
B
239
S
37
G
15
Posts: 1,922
Reputation: 39,744

Post » Fri Mar 20, 2015 10:52 am

grigrizljac wrote:Try like this ... Works for me :):


Excellent! But how do i do when i want to important multiple images? Like perhaps say i wanna important 3 images, they all turn into the same first image i imported..
B
5
S
1
Posts: 37
Reputation: 451

Post » Fri Mar 20, 2015 11:09 am

https://www.scirra.com/manual/182/file-chooser

Specifically:
Select
Whether to allow selecting a single file only, or multiple files in one go.


...and
FileNameAt(index)
Return the name of the chosen file at an index. In Single select mode, the index should always be 0, since only one file can be chosen.


Therefore, the first of a multiple select would have index of zero, next 1, then 2 etc....
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,191
Reputation: 54,287

Post » Fri Mar 20, 2015 11:42 am

zenox98 wrote:https://www.scirra.com/manual/182/file-chooser

Specifically:
Select
Whether to allow selecting a single file only, or multiple files in one go.


...and
FileNameAt(index)
Return the name of the chosen file at an index. In Single select mode, the index should always be 0, since only one file can be chosen.


Therefore, the first of a multiple select would have index of zero, next 1, then 2 etc....


Yeh i already understand that, i just can't get it to work, i set it to, ''Every tick'' set sprite = (0), sprite2 = (1) etc as you described above.
Still all of them reload as soon as i choose a new file to import.
Thank you for your time and trying to explain it to me, i still didnt get it.. Newely bought C2 ^_^

Edit: It works when i import multiple files at once, but not when i import 1 by 1 -
B
5
S
1
Posts: 37
Reputation: 451


Return to How do I....?

Who is online

Users browsing this forum: ankas, tetuan and 10 guests