Created
February 27, 2018 11:54
-
-
Save jhollingworth/84db653a7df1e5b7675394bea8e00ac4 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<div id="container"></div> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.7.0/pixi.js"></script> | |
<script type="text/javascript"> | |
var app = new PIXI.Application(800, 600, { transparent: true }); | |
document.getElementById('container').appendChild(app.view); | |
var texture = PIXI.Texture.fromImage('https://i.kinja-img.com/gawker-media/image/upload/s--fbE5h4t0--/c_scale,fl_progressive,q_80,w_800/1501840081290294050.jpg'); | |
var style = new PIXI.TextStyle({ | |
fontFamily: 'Arial', | |
fontSize: 200, | |
fontWeight: 'bold', | |
}); | |
var text = new PIXI.Text('Godzilla', style); | |
text.x = 0 | |
text.y = 100 | |
var godzilla = new PIXI.Sprite(texture); | |
godzilla.width = 800; | |
godzilla.height = 449; | |
godzilla.mask = text; | |
app.stage.addChild(godzilla); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment