lavrton Posted October 24, 2014 Share Posted October 24, 2014 Hello. I am buildind mind map application.There are huge number of nodes on canvas (eg 1000).Node is simple rectange + text. Every node is unique. How can I draw such nodes with Phaser? I know there is `Phaser.BitmapData`: bmd = game.add.bitmapData(800,600); // Draw circle bmd.ctx.fillStyle = '#999999'; bmd.ctx.beginPath(); bmd.ctx.arc(300, 200, 100, 0, Math.PI*2, true); bmd.ctx.closePath(); bmd.ctx.fill(); // Put BitmapData in a Sprite sprite = game.add.sprite(0, 0, bmd);But each bitmap is a new <canvas> element. And I will loose memory in this case. There is also `Phaser.Graphics` class. But I can't draw text with it, right? Link to comment Share on other sites More sharing options...
rich Posted October 25, 2014 Share Posted October 25, 2014 I would use the Canvas objects as the textures for Phaser.Sprites rather than creating anything in between, but it depends if the canvas contents are going to update a lot or not. Link to comment Share on other sites More sharing options...
Recommended Posts