PadreMontoya Posted September 18, 2014 Share Posted September 18, 2014 Hello, I'm working on a match-3 game where blocks "fall in" from the top of the board, rather than just "appear" in the top-most space. What I'd like to do is dynamically create a BitmapData mask that is in the shape of the 8x8 board and attach it to the group. This way any blocks that drop in outside the boundary of the board can't be seen until they slide in. It seems like the only way to do this would be to create a mask for every sprite that is dropping in, and dynamically adjust it every refresh. Either that or maybe crop new blocks as they are dropping in. Is there a better way to do it? Link to comment Share on other sites More sharing options...
rich Posted September 18, 2014 Share Posted September 18, 2014 Use a mask on the board itself, not the sprites. You can use Phaser.Graphics for a mask - so create the shape you need using Graphics commands, fill it and then set it to be the mask for the board. Then anything that is a child of the board will automatically be masked off. Link to comment Share on other sites More sharing options...
Recommended Posts