Hello
I would like to configure offsets on texture (not on sprites).
Why this example does not work ?
const app = new PIXI.Application({
resizeTo: window,
backgroundColor: 0x999999
});
document.body.appendChild(app.view);
PIXI.Assets.add('bunny', 'https://pixijs.io/examples/examples/assets/bunny.png');
PIXI.Assets.load(['bunny']).then((textures) =>
{
let texture = textures['bunny'];
let tmp = new PIXI.Texture(
texture,
new PIXI.Rectangle(
0,
0,
20,
20,
)
);
texture.defaultAnchor.x = 30; // wrong instruction ? Does not work
const sprite = PIXI.Sprite.from(tmp);
app.stage.addChild(sprite);
});
Thanks,