Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Canvas renderer - masks problems

$
0
0

Hello everyone. I make a application, the first on Webgl renderer. All works fine, but on mobile devices less perfomance. So i try - a canvas renderer ( forceCanvas mode) - perfomance very very good on mobile now. But a many new problems appeared :

In webgl - shape with rect hole,  in canvas - no hole.  Please help me, how i can add hole in canvas mode.  

const shape = new Graphics();

shape.clear();
shape.beginFill(0xff0000);
shape.moveTo(0, 0);
shape.lineTo(500, 0);
shape.lineTo(500, 500);
shape.lineTo(0, 500);
 
shape.moveTo(100, 100);
shape.lineTo(200, 100);
shape.lineTo(200, 200);
shape.lineTo(100, 200);
shape.addHole();

Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>