Jump to content

How to use phaser with huge number canvas primitives?


lavrton
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...