Jump to content

mask


valentinaCom
 Share

Recommended Posts

Hi :)

 

I have in my game a sound playing and I did a progress bar that reprecent the sound duration. 

The bar and buttons (play/stop) are all in a group.

My problem is that when I put a mask to the progress bar, it put it to all the group.

 

how can I do to put the mask only to one object of the group?

here's the code: (the image "full_music_bar" is ina a group called "_soundGroup").

durationAnim:function(){        var maskGraphics = new Phaser.Graphics();        maskGraphics.beginFill();        maskGraphics.drawRect(this.full_music_bar.x, this.full_music_bar.y, 245, 11);        this.full_music_bar.x+=245;        maskGraphics.endFill();        game.add.graphics(maskGraphics);        this.full_music_bar.mask = maskGraphics;        this._timerTween = game.add.tween(this.full_music_bar);        this._timerTween.to({x: this.full_music_bar.x - 245}, this._currentSound.durationMS, Phaser.Easing.Linear.None, true).onComplete.add(function () {            maskGraphics.destroy();        }, this);    }
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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