Jump to content

Multiple Masks


phreaknation
 Share

Recommended Posts

Trying to mask an object. Having an issue where as all I see is the mask.

 

I try and create a filled BMD then apply the mask to the BMD then create a sprite from that BMD to overlay a sprite in a group. Not having any luck. Suggestions?

      this.groupPlayer = this.add.group();
      this.groupPlayer.position.x = x;
      this.groupPlayer.position.y = y;
 
      this.player = this.add.sprite(0, 0, 'megaman');
      this.player.anchor.setTo(0.5, 0.5);
 
      this.mask1Fill = this.game.add.bitmapData(610, 598);
      this.mask1Fill.fill(255,128,0);
 
      this.mask1image = this.game.add.image(0, 0, 'mask_secondary');
 
      this.mask1 = this.game.add.bitmapData(610, 598);
      this.mask1.alphaMask(this.mask1Fill, this.mask1mask);
      this.maskSecondary = this.add.sprite(0, 0, this.mask1);
 
this.groupPlayer.add(this.player);
      this.groupPlayer.add(this.maskSecondary);
 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...