Created
February 27, 2018 09:50
-
-
Save jhollingworth/41403b8462849f115c08b91fe73ec67f 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; | |
text.mask = godzilla | |
app.stage.addChild(text); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment