Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Tween point of a graphic


JcKairos
 Share

Recommended Posts

for (let i = 1; i < xPoints.length-1; i++){
    a= i*2
    this.game.add.tween(graphicsend.currentPath.shape._points).to({a: (225-newypoint[i]) }, 500, Phaser.Easing.Linear.None, true);
}
for (let i = 1; i < yPoints.length-1; i++){
    b= i*2 +1 
    this.game.add.tween(graphicsend.currentPath.shape._points).to({b: (315-newxpoint[i]) }, 500, Phaser.Easing.Linear.None, true);
}

Hi, I am trying to tween the points of a graphic but I am having trouble looping it. The a and b variable I set is useless but if I set it to

for (let i = 1; i < xPoints.length-1; i++){
    a= i*2
    this.game.add.tween(graphicsend.currentPath.shape._points).to({2: (225-newypoint[i]) }, 500, Phaser.Easing.Linear.None, true);
}
for (let i = 1; i < yPoints.length-1; i++){
    b= i*2 +1 
    this.game.add.tween(graphicsend.currentPath.shape._points).to({3: (315-newxpoint[i]) }, 500, Phaser.Easing.Linear.None, true);
}

it works. Is there any way to represent the numbers to be tweened?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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