Skip to content

Instantly share code, notes, and snippets.

@jhollingworth
Created February 27, 2018 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhollingworth/41403b8462849f115c08b91fe73ec67f to your computer and use it in GitHub Desktop.
Save jhollingworth/41403b8462849f115c08b91fe73ec67f to your computer and use it in GitHub Desktop.
<!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