SHARE
TWEET

Untitled

a guest Aug 31st, 2019 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     'use strict';
  2.     const app = new PIXI.Application({width: 1280, height: 720});
  3.     document.body.appendChild(app.view);
  4.     let sprites_container = new PIXI.Container();
  5.  
  6.     PIXI.Loader.shared
  7.         .add("test", "test.json")
  8.         .load(setup);
  9.     app.stage.addChild(sprites_container);
  10.  
  11.     function setup() {
  12.         let sheet = PIXI.Loader.shared.resources["test"].spritesheet;
  13.         let ticker = PIXI.Ticker.shared;
  14.         let renderer = PIXI.autoDetectRenderer();
  15.         ticker.add(function (time) {
  16.             sprites_container.removeChildren();                        
  17.             for (let j = 0; j <= 25; j++) {
  18.                 for (let i = 0; i <= 50; i++) {
  19.                     let sprite2 = new PIXI.Sprite(sheet.textures[((i % 5) + 1).toString() +".png"]);
  20.                     sprites_container.addChild(sprite2);
  21.                     sprite2.x = i*30;
  22.                     sprite2.y = j*16
  23.             }
  24.         }
  25. });}
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