import * as PIXI from 'pixi.js';
const app = new PIXI.Application({ background: '#1099bb', resizeTo: window });
document.body.appendChild(app.view);
PIXI.Assets.load('https://pixijs.com/assets/bg_grass.jpg').then((texture) =>
{
const plane = new PIXI.SimplePlane(texture, 10, 10);
plane.x = 100;
plane.y = 100;
app.stage.addChild(plane);
const buffer = plane.geometry.getBuffer('aVertexPosition');
let timer = 0;
app.ticker.add(() =>
{
for (let i = 0; i < buffer.data.length; i++)
{
buffer.data[i] += Math.sin((timer / 10) + i) * 0.5;
}
buffer.update();
timer++;
});
});