How do I create multiple tilemap layouts with one texture?

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hi, I'm trying to make several tilemap layouts that could share the same tileset, but for every tilemap in the project there's also a unique texture, even if the tilemaps share the same original source image. Can someone suggest a workaround for this problem?

    My thought was to save off layouts as some XML or JSON format and load them as-needed, but I'm not sure how to do that. A workflow like this:

    Create tilemap in Construct to serve as a tileset.

    Create layouts using that tileset in Tiled editor and export as XML or JSON format that Construct can load (or TMX if that works - I don't care what format).

    At runtime, spawn tilemaps and size/populate them using the previously-exported Tiled data.

    Alternatively I wouldn't mind creating the tilemap variations in Construct's tilemap editor. These layouts aren't that complicated but there are many of them and they will need to be created dynamically, repeatedly.

    Any suggestions would be great, thanks all.

  • Put them all on the same tile map....Count the images for each set

    Then when you are drawing the map you just add thenumbers of the tiles of the tileset * The desired tileset number then you do your draw commands.

    TilenumberToDraw=DesiredTileNumber+(number of tiles to next set*1)

    *1 will draw from the first tileset, *2 will draw from the second... Etc...

    Put all of the shared tiles at the very top, so you can add as many tilesets as you want, without moving them every time.

  • Bye the way, you can use the WebGL Set color, and Set HSV to adjust the colors of sprites, layers, backgrounds....

    So if you are just doing the exact same shapes, but changing the color each level, you might want to use the effects instead of making a huge download.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks jojoe, that's the nudge I needed!

    I wrote a function that takes parameters for where a given sub-tilemap is on the giant tilemap, and copies the tiles from that spot to the upper-left corner of a tilemap instance, and then resizes the tilemap instance to the size of the sub-tilemap. It functions just like I need it to.

    It's not ideal, workflow-wise - I would prefer that Construct tilemaps could share tileset textures (the way Tiled is set up.) But this seems like a good workaround.

    As for the WebGL suggestion, I could get some interesting variety out of that technique too. Thanks again for sharing your ideas!

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