pixijs照明灯做法

pixijs照明灯做法

 

   <script src="js/pixi.min.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    const app = new PIXI.Application({ width: 750, height: 1206 });
    document.body.appendChild(app.view);


   const bgdi = PIXI.Sprite.from('https://pixijs.io/examples/examples/assets/bg_rotate.jpg');
     bgdi.width=750;
     bgdi.height=1206;
    app.stage.addChild(bgdi);

    const graphics = new PIXI.Graphics();


   graphics.beginFill(0x000000,0.6);
   graphics.drawRect(0, 0, 750, 1206);
   graphics.endFill();

app.stage.addChild(graphics);




    const bg = PIXI.Sprite.from('https://pixijs.io/examples/examples/assets/bg_rotate.jpg');
     bg.width=750;
     bg.height=1206;
     


    app.stage.addChild(bg);

      const yuan = PIXI.Sprite.from('/moban/images/yuan.png');
     yuan.width=400;
     yuan.height=400;     
     yuan.x=100;
     bg.mask=yuan;
         app.stage.addChild(yuan);
    </script>

 

posted @ 2020-10-03 18:29  newmiracle宇宙  阅读(217)  评论(0编辑  收藏  举报