其他分享
首页 > 其他分享> > pixijs照明灯做法

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>

 

标签:yuan,const,app,bg,PIXI,graphics,做法,pixijs,照明灯
来源: https://www.cnblogs.com/newmiracle/p/13765093.html