Cristy94 / canvas-mock

I created this to be used when running Phaser.js in a Node.js environment. This can be used instead of node-canvas to simulate the existance of canvas.
MIT License
5 stars 1 forks source link

Add new method to canvas context list #1

Open wimrijnders opened 7 years ago

wimrijnders commented 7 years ago

Please add the following method:

      measureText: function(text) {
        return {
          width:  12*text.length,
          height: 14
        };
      },

For this one, it's useful to return some kind of token value, in order to ensure the caller does not choke on the results.