Jump to content

How to use phaser with huge number canvas primitives?


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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