LocalPreview where are the assets?

Get help using Construct 2

Post » Sun Apr 01, 2012 10:04 am

I'm lazy loading images to avoid preloading, to test on local preview I need to copy my files in a directory relative to the server preview which looks like it start from somewhere which is not the project directory. Where it is loaded from? Thanks!
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Sun Apr 01, 2012 10:34 am

@0plus1: I've seen that you tried the Inject base64 string as Sprite Image behavior. Have you tried loading the strings dynamically when needed with AJAX and then inject them in the sprites? I suppose this should work.
Another possibility: There are some custom plugins that can load images in runtime. I've used the HTML-Div Plugin(original plugin from JesseJoh --> Kyatric's download link) for this short demo(capx) and it works in preview (with an "absolute image URL").Joe72012-04-01 10:53:35
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Sun Apr 01, 2012 11:07 am

My problem is different, I need to understand how c2 loads stuff.
If I "compile" for html5 and add my directory it works like a charme.
Inject "myfolder/myasset.png"

In local preview it does not because I don't know where c2 starts (so I can't put files relative to it's directory).

I also have a big problem with PhoneGap iOS, loading with inject hangs c2 because it can't find the image, in theory from the phonegap docs everything under the www/ directory is trated locally but it doesn't work. It looks like it can't find files while in reality they should be there.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Sun Apr 01, 2012 11:55 am

Iphone I've fixed the issue and I was able to dynamically load assets at runtime! Still it would be helpful to have a way to debug on local preview I wait for @Ashley to tell me where are the assets for local preview stored.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Sun Apr 01, 2012 4:53 pm

The local server has no specific directory on disk - it creates a virtual file structure, which is composed of different files from different places on disk. So I'm afraid this is not currently supported...
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,554

Post » Sun Apr 01, 2012 11:28 pm

Thanks @Ashley, not a very big deal, as without the images the game is around 1mb with sounds I can manage to "compile" it.
You may consider this for a future version though.
The inject plugin is genious and is a lifesaver for advanced user that need more flexibility in memory managment.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294


Return to How do I....?

Who is online

Users browsing this forum: JonnyBrove, Skebab and 17 guests