Jump to content

draw Base64 png data with phaser.js


skywalker
 Share

Recommended Posts

hello everyone im making a game with phaser and i want to take a screenshot from one scene and draw it to another by using game.canvas.toDataURL(); this is what i have tried so far

in the first scene GAME.cc = game.canvas.toDataURL();

second one

var img = new Image();
img.onload = function(){
var base = new PIXI.BaseTexture(this),
texture = new PIXI.Texture(base);

var sp = game.add.sprite(0,0);
sp.setTexture(texture);

};

img.src = GAME.cc;

there is no error in console but the sprite is completely black !! so ... what is the problem . 

 

on stackoverflow http://stackoverflow.com/questions/29733356/draw-base64-png-data-with-phaser-js

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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