SHARE
TWEET

Untitled

a guest Dec 14th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* P I X I */
  2.  
  3. let type = "WebGL"
  4. if(!PIXI.utils.isWebGLSupported()){
  5.   type = "canvas"
  6. }
  7.  
  8. PIXI.utils.sayHello(type)
  9.  
  10. //Create a Pixi Application
  11. let app = new PIXI.Application({
  12.     width: 256,         // default: 800
  13.     height: 256,        // default: 600
  14.     antialias: true,    // default: false
  15.     transparent: false, // default: false
  16.     resolution: 1,      // default: 1
  17.     forceCanvas: true
  18. });
  19.  
  20. app.renderer.view.style.position = "absolute";
  21. app.renderer.view.style.display = "block";
  22. app.renderer.autoResize = true;
  23. app.renderer.resize(window.innerWidth, window.innerHeight);
  24. app.renderer.backgroundColor = 0x061639;
  25. app.stage
  26.  
  27. PIXI.loader
  28.   .add("./img/money.gif")
  29.   .load(setup);
  30.  
  31. function setup() {
  32.   let sprite = new PIXI.Sprite(
  33.     PIXI.loader.resources["./img/money.gif"].texture
  34.   );
  35. }
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