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>
如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/