How do I make my tilemap objects load from files?

Get help using Construct 2

Post » Thu Oct 01, 2015 7:48 am

Hi,

I want a group at the start of the frame to load a new image into the tilemap objects, but not from a URL, from a file... specifically I intend for the game to be exported via Node Webkit to Windows, Mac and Linux.

Can someone please set me straight on what I would put in the "load image from URL" action to get it to load an image from the install folder of the game for example?

Thanks very much.

-Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,071

Post » Thu Oct 01, 2015 8:17 am

Brashmonkey wrote:Hi,

I want a group at the start of the frame to load a new image into the tilemap objects, but not from a URL, from a file... specifically I intend for the game to be exported via Node Webkit to Windows, Mac and Linux.

Can someone please set me straight on what I would put in the "load image from URL" action to get it to load an image from the install folder of the game for example?

Thanks very much.

-Mike

You can use the NW.JS to do that. Like so:

Code: Select all
NWjs.AppFolder & "Filename.ext"


However be advise that this wont work during development, so a good idea is to hook up a System -> is in preview so you can test it just using a fixed path.

Since you want to load it during runtime, I guess your intention is to load several different ones? However im pretty sure you will run into problems with this. Due to how graphic is handle in C2, at least images have this problem which requires some workarounds that are not really good. Anyway if that is not your intention you should have no problem doing it that way.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Thu Oct 01, 2015 9:28 am

Thanks.
B
49
S
9
G
4
Posts: 426
Reputation: 7,071


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 22 guests