(function(phina, PIXI) {
  phina.define('phina.pixi.PixiTexture', {
    superClass: phina.asset.Asset,

    init: function() {
      this.superInit();
    },

    _load: function(resolve) {
      var self = this;
      PIXI.loader.add(this.key, this.src).load(function(loader, resources) {
        self.pixiTexture = resources[self.key].texture;
        resolve(self);
      });
    },

    createFrame: function(x, y, width, height) {
      if (typeof x === 'object') {
        y = x.y;
        width = x.width;
        height = x.height;
        x = x.x;
      }
      var newTexture = phina.pixi.PixiTexture();
      newTexture.phinaTexture = this.phinaTexture;
      newTexture.pixiTexture = new PIXI.Texture(this.pixiTexture.baseTexture, new PIXI.math.Rectangle(x, y, width, height));

      return newTexture;
    },
    
    setKey: function(key) {
      this.key = key;
      return this;
    }
    
  });

  phina.asset.AssetLoader.register('pixi', function(key, path) {
    return phina.pixi.PixiTexture().setKey(key).load(path);
  });

}(phina, PIXI));
@@ -635,60 +635,8 @@
 );%0D%0A
-      newTexture.phinaTexture = this.phinaTexture;%0D%0A
     
@@ -867,24 +867,832 @@
 turn this;%0D%0A
+    %7D,%0D%0A    %0D%0A    /**%0D%0A     * @param %7BHTMLCanvasElement%7D canvas%0D%0A     */%0D%0A    fromCanvas: function(canvas) %7B%0D%0A      this.pixiTexture = PIXI.Texture.fromCanvas(canvas);%0D%0A      return this;%0D%0A    %7D,%0D%0A%0D%0A    /**%0D%0A     * @param %7Bphina.display.Shape%7D shape%0D%0A     */%0D%0A    fromShape: function(shape) %7B%0D%0A      if(shape._dirtyDraw) %7B%0D%0A        shape.render(shape.canvas);%0D%0A      %7D%0D%0A      return this.fromCanvas(shape.canvas.domElement);%0D%0A    %7D,%0D%0A%0D%0A    _static: %7B%0D%0A      %0D%0A      /**%0D%0A       * @param %7BHTMLCanvasElement%7D canvas%0D%0A       */%0D%0A      fromCanvas: function(canvas) %7B%0D%0A        return phina.pixi.PixiTexture().fromCanvas(canvas);%0D%0A      %7D,%0D%0A%0D%0A      /**%0D%0A       * @param %7Bphina.display.Shape%7D shape%0D%0A       */%0D%0A      fromShape: function(shape) %7B%0D%0A        return phina.pixi.PixiTexture().fromShape(shape);%0D%0A      %7D%0D%0A
     %7D%0D%0A    %0D

fix texture from canvas and shape