Jump to content



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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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