InsaLili Posted May 22, 2014 Share Posted May 22, 2014 Hello everyone, I am very new to phaser. I am trying to make a jigsaw puzzle with it. Firstly I wanted to use "Graphics" to draw a irregular pieces of the puzzle. But it doesn't support "graphics.quadraticCurveTo( )". So I turn to use "bitmapdata" to draw the pieces. The problem is, I can't fill in the irregular shape with image. The image is filled in the whole bitmapdata space, overpasses the shape i drew. Is there any methods that can let me draw an irregular shape and fill it with image? Thanks in advance for any help! Link to comment Share on other sites More sharing options...
BigRob154 Posted May 22, 2014 Share Posted May 22, 2014 Here you go. Your keyword is "masking". BTW: You should be able to get direct canvas context from BitmapData or Graphics. InsaLili 1 Link to comment Share on other sites More sharing options...
rich Posted May 22, 2014 Share Posted May 22, 2014 You'll need to use a globalCompositeOperation, most likely source-atop. cristlee, InsaLili and lokhmakov 3 Link to comment Share on other sites More sharing options...
InsaLili Posted May 23, 2014 Author Share Posted May 23, 2014 Yes, this is exactly what i want. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts