I'm trying to display some images and then view them via a data uri export of the canvas.
I can do text, shapes etc, but when I interact with the Loader, it either hangs (if I try to make it load) or it just has nothing on screen. Not sure where to look...
const PIXI = require('pixi-shim')
const app = new PIXI.Application({
backgroundColor: 0x1099bb,
width: 1000,
height: 1000
});
// pulled from old issue, breaks immediately with "app.stage.addChild(new (require('pixi-shim') as any).Sprite.fromImage('cas.png'));"
// app.stage.addChild(new (require('pixi-shim') as any).Sprite.fromImage('cas.png'));
// executes, but I get nothing on the canvas
app.stage.addChild(PIXI.Sprite.from(tex));
// Some random thing, this works ok
const graphics = new PIXI.Graphics();
graphics.beginFill(0xDE3249);
graphics.drawRect(500, 50, 100, 100);
graphics.endFill();
app.stage.addChild(graphics);
app.render() // not seen in any examples, but if this isn't here, the canvas is blank
const data = app.view.toDataURL("image/png", 1); // works, but only shows the geometry
Not sure what I'm doing wrong, as this feels like it should work. Is there a race or requirements I've missed somewhere?