casarock Posted November 2, 2013 Share Posted November 2, 2013 Hi, I am currently experimenting with some kind of endless scroller/runner game. Therefore I want to implement a custom Map Rendering based on segments which are being concatenated and - when out of sight - deleting from a dynamic tiles array. I would like to know if it is (easily) possible to render a specific tile which I get from tileset.tiles array. A deeper look into "TilemapLayer.js" shows, that phaser simply uses "drawImage" on the canvas context. Trying to draw the tile using canvas at my update-method wasn't successful. When I put it into my render-method it flickers. My concrete question: - Is it possible (means: powered by phaser!) to render a tile without having a tilemap for some kind of cutom tilemapping? Thanks in advance! Link to comment Share on other sites More sharing options...
rich Posted November 2, 2013 Share Posted November 2, 2013 For that I would use a RenderTexture really, which is effectively just a blank canvas which you can draw whatever you need on to. Link to comment Share on other sites More sharing options...
casarock Posted November 2, 2013 Author Share Posted November 2, 2013 Hi, I didn't saw renderTexture. Looks nice. But I would like to have the power of a structured tileset (colision etc.) with my own rendering. Maybe I got you wrong. Your idea is rendering the segment into a texture and concatenating? Unfortunately renderTexture is not covered with documentation at the moment. I'll play with renderTexture. Maybe I get the idea or an other way. CheersCarsten Link to comment Share on other sites More sharing options...
rich Posted November 3, 2013 Share Posted November 3, 2013 You could easily just extend TilemapLayer and replace the rendering function with your own - however that won't get around needing to redo how collision is handled, so I still reckon you're better off just writing your own and rendering it yourself. Link to comment Share on other sites More sharing options...
casarock Posted November 3, 2013 Author Share Posted November 3, 2013 Extending TilemapLayer sounds interesting. At the moment I'm playing around with a plugin. And you are right, I have to take care of collision. Thank you for your support. I'll try some things and I'll be back with my "solution" Link to comment Share on other sites More sharing options...
Recommended Posts