osinski Posted January 6, 2015 Share Posted January 6, 2015 Hi!I draw 2 rectangles var bigRect = this.game.add.graphics(0, 0); bigRect.lineStyle(0); bigRect.beginFill(0x3a1603,.43); bigRect.drawRect(900, 120, 880, 880); var smallRect = this.game.add.graphics(0, 0); smallRect.lineStyle(0); smallRect.beginFill(0xFFFFFF,1); smallRect.drawRect(1100, 250, 100, 100); Can I get a hole in bigRect http://joxi.ru/8AnGvx9sNQk8rO using mask? Is it possible without mask? Link to comment Share on other sites More sharing options...
osinski Posted January 6, 2015 Author Share Posted January 6, 2015 Hi!I draw 2 rectangles var bigRect = this.game.add.graphics(0, 0); bigRect.lineStyle(0); bigRect.beginFill(0x3a1603,.43); bigRect.drawRect(900, 120, 880, 880); var smallRect = this.game.add.graphics(0, 0); smallRect.lineStyle(0); smallRect.beginFill(0xFFFFFF,1); smallRect.drawRect(1100, 250, 100, 100); Can I get a hole in bigRect http://joxi.ru/8AnGvx9sNQk8rO using mask? Is it possible without mask?I loaded 2 png rectangles instead of Graphics rectangles and made something like thatvar bmd = this.game.make.bitmapData(880, 881);bmd.draw('bigRect').blendDestinationOut().draw('mask', 110, 250).blendReset();this.game.add.image(897, 122, bmd);Anyone know better way? Link to comment Share on other sites More sharing options...
Lizard Posted December 14, 2016 Share Posted December 14, 2016 Same problem, is here any way to make hole in graphics object? Dont want use bitmapdata as it have some problems with showing on ios. Link to comment Share on other sites More sharing options...
Recommended Posts