sssssssssss
10-11-2013, 12:40 AM
I'm trying to get all the layers of a level and save as an image. I can get a specific layer just fine, but trying to get them all on one image seems to have stumped me. If I take out the temp.r loop, change the @= for temp.tile to just =, and set tilelayers[0] then it works fine one 1 layer. I know I'm just doing this wrong probably, but if it's even possible I can't wrap my head on how to do it. Using dustys TileLayers script btw.
for (temp.i = 0; temp.i < 64; temp.i++) {
for (temp.k = 0; temp.k < 64; temp.k++) {
temp.tilex = i;
temp.tiley = k;
for (temp.r = 0; temp.r < 6; temp.r++) {
temp.tile @= tilelayers[r].tiles[temp.tilex, temp.tiley];
temp.imagetile = TilesToImage(temp.tile);
}
temp.tilesetImage = "roak_tileset_gmap_overworld.png";
this.levelImg.drawimagestretched(i * 16, k * 16, 16, 16, temp.tilesetImage, temp.imagetile[0], temp.imagetile[1], 16, 16);
}
}
(I started out using it in the control, but it just wouldn't work, so I had to put the control in a var)
I also might as well ask how to do this with a gmap instead of just one level as well, obviously I'm trying to just draw out the map per the levels and layers.
for (temp.i = 0; temp.i < 64; temp.i++) {
for (temp.k = 0; temp.k < 64; temp.k++) {
temp.tilex = i;
temp.tiley = k;
for (temp.r = 0; temp.r < 6; temp.r++) {
temp.tile @= tilelayers[r].tiles[temp.tilex, temp.tiley];
temp.imagetile = TilesToImage(temp.tile);
}
temp.tilesetImage = "roak_tileset_gmap_overworld.png";
this.levelImg.drawimagestretched(i * 16, k * 16, 16, 16, temp.tilesetImage, temp.imagetile[0], temp.imagetile[1], 16, 16);
}
}
(I started out using it in the control, but it just wouldn't work, so I had to put the control in a var)
I also might as well ask how to do this with a gmap instead of just one level as well, obviously I'm trying to just draw out the map per the levels and layers.