Updating from 2.8.0/Pixi.Texture.from

Hi,

So there is no longer a Pixi.Texture.fromImage('path') – what is the alternative now?

Do I have to use (?):

game.load.image('img_id', 'path');
img = new PIXI.Texture(game.cache.getBaseTexture('img_id');

The data doesn’t seem to be the same & is erroring out for me with :

"PIXI.Float32Array is not a constructor"

Any ideas?

Could you put the code online somewhere?
It works for me on 2.17.0.

https://sondro.github.io/C2D-Web/file/src/kit/Phaser/Phaser2/demo/Phaser2-RaptorPack.html

It fails at

this.verticies = new PIXI.Float32Array(this.pack_renderer.render_points.length);

in

var creature_renderer = new Phaser.CreaturePackDraw

The PIXI.Texture constructor works fine, so maybe create a new topic why CreaturePackDraw fails.

In 2.8 I can just use Pixi.Texture.fromImage(‘path’) and it works.

Yeah, but then 2.8 probably uses an other Pixi version…
Maybe try a newer version of CreaturePack.
(as a quick fix you can try just changing PIXI.Float32Array to Float32Array)

Didn’t really want to change that, but if I doubt there is much of a performance difference between PIXI.Float32Array & Float32Array.