I am working on image corousal (Image slide). I have two images in two different container under main container. Canvas size is 270* 270. So two containers are set in a position of -270, 0. When user starts slide right animation, I will start ticker and will stop until second container reaches to x coordinate '0'.
this.appRenderer.ticker.add(delta => this.tickSlideRight(currentSlideNumber,delta));
// ticker right slide
tickSlideRight(currentSlideNumber,delta){
try{
this.imageBaseContainer[currentSlideNumber].x += 1 + delta;
if(this.imageBaseContainer[currentSlideNumber].x >= this.appRenderer.screen.width)
{
console.log(this.imageBaseContainer[currentSlideNumber].x, this.appRenderer.screen.width);
this.appRenderer.ticker.stop();
}
}catch(ex){
alert(ex.message); //TO-DO
}
}
Can anybody helps me to give duration for ticker within container slide should be happend.