How do I load images from relative links

Get help using Construct 2

Post » Mon Nov 17, 2014 5:25 pm

Hey, I'm working on a project in which i need to load images from relative link. The problem is i'm not sure how to call a proper path. Let's say I got it on "www.gamedomain.com". I did links to external files (images loaded into a sprite):

{ Load image from "www.gamedomain.com/data/minigame1/image.jpg". }

Asuming that the main file is executioned from "www.gamedomain.com" i tried put path links like

{ Load image from "/data/minigame1/"&loadedImage } (loadedImage a variable that holds file name).

Unfortunately it didn't work. Any idea how to make it possible? I asume that if it will work I could load files the same way from local drive from relative to the game file path - is it right?

Any help would be appreciated. Thanks in advance :)
B
6
S
2
Posts: 14
Reputation: 478

Post » Mon Nov 17, 2014 7:10 pm

Did you try without the first forward slash?
(i.e. "data/minigame1..." instead of "/data/minigame1...")
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 18, 2014 7:17 pm

Hey, it worked now as you wrote "Hundredfold".

I tired it befeore but didn't see it working on local host that's why i thought it was wrong. To makt it work locally i had to export project to html, lunch and preview on firefox.
B
6
S
2
Posts: 14
Reputation: 478

Post » Wed Aug 16, 2017 4:33 pm

Message: markaspirenet can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I see this is very old so not sure it's being monitored. I also need to do the same thing. If you set it to use a relative link is it possible to continue to develop and test the game without compiling it with the images coming from another folder?

This is my explanation of what I want to do, it sounds similar
viewtopic.php?f=147&t=195085

Odd how the / is missed off, I would have expected as in HTML to start the link with a /
B
2
Posts: 5
Reputation: 166


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests