Initial tutorial setup
This commit is contained in:
commit
566910bdcc
10
index.html
Normal file
10
index.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Pixi.js stuff</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.2.2/pixi.min.js"></script>
|
||||||
|
<script src="tutorial.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
16
tutorial.js
Normal file
16
tutorial.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//Create the renderer
|
||||||
|
var renderer = PIXI.autoDetectRenderer(256, 256);
|
||||||
|
|
||||||
|
//Add the canvas to the HTML document
|
||||||
|
document.body.appendChild(renderer.view);
|
||||||
|
|
||||||
|
//Create a container object called the `stage`
|
||||||
|
var stage = new PIXI.Container();
|
||||||
|
|
||||||
|
//Tell the `renderer` to `render` the `stage`
|
||||||
|
renderer.render(stage);
|
||||||
|
|
||||||
|
renderer.view.style.position = "absolute";
|
||||||
|
renderer.view.style.display = "block";
|
||||||
|
renderer.autoResize = true;
|
||||||
|
renderer.resize(window.innerWidth, window.innerHeight);
|
Loading…
Reference in New Issue
Block a user