SHARE
TWEET

Untitled

a guest May 21st, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.       <meta charset="UTF-8" />
  5.         <link rel="stylesheet" type="text/css" href="styles.css" />
  6.         <title> Trying New Stuff</title>
  7.     </head>
  8.     <body>
  9.       <script src="pixi-v5.min.js"></script>
  10.       <script>
  11.         var app;
  12.          
  13.           function initPiki() {
  14.               app = new PIXI.Application({width: window.innerWidth, height: window.innerHeight});
  15.               document.body.appendChild(app.view);
  16.              
  17.               var image = new PIXI.Sprite.from("Popculture.jpg");
  18.               image.width = window.innerWidth;
  19.               image.height = window.innerHeight;
  20.               app.stage.addChild(image);
  21.              
  22.               displacementSprite = new PIXI.Sprite.from("displacementmaps.jpg");
  23.               displacementFilter = new PIXI.filters.DisplacementFilter(displacementSprite);
  24.               displacementSprite.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
  25.               app.stage.addChild(displacementSprite);
  26.               app.stage.filters = [displacementFilter];
  27.               animate();
  28.             }
  29.           function animate(){
  30.               displacementSprite.x += 8;
  31.               displacementSprite.y += 3;
  32.               requestAnimationFrame(animate);
  33.           }
  34.          
  35.           initPixi();
  36.          
  37.         </script>    
  38.     </body>
  39.  
  40. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top