SOLVED How do I change tilemap image at runtime?

0 favourites
  • 7 posts
From the Asset Store
This is a black tileset with 2 tilemaps, props, one animated character and more.
  • I'm trying to figure out a way (if at all possible) to change the image that the tilemap uses while the game is running?I know that I can load the image for the tilemap from a URL but as far as I can tell that's the only way. Is it possible to use this function to load the image from Construct 2 itself? I do realize there are alternatives to handling what I need done(essentially switching from a good tilemap to an evil tilemap) but I'd like to avoid having to overlap and handle two separate maps at the same time.

  • +1

    I am curious too!

    All I could do to copy the tilemap and change the iamge of it and put it under the original and I switched the visibility of the original to achive soemthing like that. But this solution is unconfortable, bad, ugly and I am sure doing these on all of my layouts are wasting a lot of resource.

  • something like this ?

    https://goo.gl/dhP9qi

  • You can add an image file to the "Files" folder in C2 (for example "new_tiles.png") and then use "Tilemap: Load image from url" and just use a name of that image file

    -> Tilemap: Load image from "new_tiles.png"

  • RamPackWobble: Not quite, I'm looking to change the image the tilemap is pulling tiles from. Switching tiles I don't have an issue with. I could use your method to just shift all the tiles down however many I need to the other set if I put it in the same image, but I'm worried about performance issues of constantly changing tiles like that when I'm using a tileswitch to animate tiles.

    shinkan: I'm going to continue poking at this to see if I can get it to work but of right now I can't get it to load the image.

  • shinkan: Thank you immensely. For some reason I wasn't thinking and was manually placing the image in the files folder instead of loading it through construct. Works perfect!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • sound great guys, thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)