odelia Posted December 1, 2015 Share Posted December 1, 2015 I have dynamic sprites (classes) in a container sprite.When I change the x or y of the container nothings happens... this.menuContainer = this.game.add.sprite(0, 0);this.menuData.forEach(function(item){ obj = new DressApp.ItemBtn(this.state, xloc, yloc, this.boxImg.width, item); yloc += obj.container.bg.height; this.menuContainer.addChild(obj);}, this);Also, I can't set a graphic mask on that sprite.I tried both ways to define a mask but it still doesn't work..var myMask = new PIXI.Graphics();//this.game.add.graphics(0, 0);//var maskWidth = this.boxImg.width;// - (this.boxImg.width * .2);var maskHeight = this.game.height * .90;myMask.beginFill(0x000000);myMask.moveTo(0, 0);myMask.lineTo(0, maskHeight);myMask.lineTo(maskWidth, maskHeight);myMask.lineTo(maskWidth, 0);myMask.lineTo(0, 0);myMask.endFill(); myMask.position.x = this.boxImg.x - (this.boxImg.width / 2);myMask.position.y = 0; this.menuContainer.mask = myMask;andvar maskX = this.boxImg.x - (this.boxImg.width / 2);var maskY = 0;var maskWidth = this.boxImg.width;// - (this.boxImg.width * .2);var maskHeight = this.game.height * .90; var mymask = this.game.add.graphics(0, 0);mymask.beginFill(0xffffff);mymask.drawRect(maskX, maskY, maskWidth, maskHeight); this.menuContainer.mask = mymask;could somebody please help me.. Link to comment Share on other sites More sharing options...
odelia Posted December 15, 2015 Author Share Posted December 15, 2015 I've solve this by putting everything in a group and moving just one item. everything else moves according to their position.. Link to comment Share on other sites More sharing options...
Recommended Posts