Created
January 6, 2018 19:23
-
-
Save jhollingworth/ae9361a260238166b32e365980b02244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PIXI.loader | |
.add('required/assets/depth_blur_BG.jpg') | |
.add('required/assets/depth_blur_moby.jpg') | |
.load(main); | |
function main() { | |
var app = { | |
screen: { | |
width: 650, | |
height: 650, | |
}, | |
stage: new PIXI.Container(), | |
}; | |
var renderer = new PIXI.WebGLRenderer({ | |
width: app.screen.width, | |
height: app.screen.width, | |
transparent: false | |
}); | |
document.body.appendChild(renderer.view); | |
var bg = PIXI.Sprite.fromImage('required/assets/depth_blur_BG.jpg'); | |
bg.width = app.screen.width; | |
bg.height = app.screen.height; | |
app.stage.addChild(bg); | |
var littleRobot = PIXI.Sprite.fromImage( | |
'required/assets/depth_blur_moby.jpg', | |
); | |
littleRobot.x = app.screen.width / 2 - 200; | |
littleRobot.y = 100; | |
app.stage.addChild(littleRobot); | |
renderer.render(app.stage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment