Do the pixijs intro
This commit is contained in:
parent
d2405f75d8
commit
b020618d57
22
pixi-test/index.html
Normal file
22
pixi-test/index.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="https://pixijs.download/release/pixi.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
let app = new PIXI.Application({ width: 640, height: 360 });
|
||||||
|
let sprite = PIXI.Sprite.from('sample.png');
|
||||||
|
|
||||||
|
app.stage.addChild(sprite);
|
||||||
|
|
||||||
|
let elapsed = 0.0;
|
||||||
|
app.ticker.add((delta) => {
|
||||||
|
elapsed += delta;
|
||||||
|
sprite.x = 100.0 + Math.cos(elapsed/50.0) * 100.0;
|
||||||
|
});
|
||||||
|
|
||||||
|
document.body.appendChild(app.view);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
pixi-test/sample.png
Normal file
BIN
pixi-test/sample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Loading…
x
Reference in New Issue
Block a user