drhayes Posted May 5, 2015 Share Posted May 5, 2015 So I figure if I want a repeating image I'll be using a TileSprite. But I can't get my layer to render to a texture to then generate the tile sprite. I don't know what's going wrong because, basically, nothing shows up and I get no errors in the console. In this code, "map" is a Tilemap instance, "layer" is a TilemapLayer added through "map.createLayer(layerName);".var texture = this.game.add.renderTexture(layer.width, layer.height);texture.renderXY(layer, 0, 0)var tileSprite = this.game.add.tileSprite(0, 0, map.widthInPixels, map.heightInPixels, texture);layer.destroy();Simply nothing shows up. I can display my other images as TileSprites successfully, but I want to be able to make a repeating background in Tiled and have it automatically show up in my game. If this doesn't work I guess I'll get Tiled to render out my backgrounds as images? That's more annoying because I'll have to do that every time I change the background. What do y'all think? Link to comment Share on other sites More sharing options...
grumpygamer Posted June 29, 2015 Share Posted June 29, 2015 Oops wrong post.Apologies Link to comment Share on other sites More sharing options...
jdnichollsc Posted July 4, 2015 Share Posted July 4, 2015 See my solution http://www.html5gamedevs.com/topic/12994-tilesprite-from-tilemap-and-tilemaplayer/ Regards, Nicholls drhayes 1 Link to comment Share on other sites More sharing options...
drhayes Posted July 6, 2015 Author Share Posted July 6, 2015 Yeah, I saw! I'm going to try this later. Thanks! jdnichollsc 1 Link to comment Share on other sites More sharing options...
Recommended Posts