Convert runAction to tween

How to convert this code to tween but don’t change any logic?

 const actions = [];
 const contentHeight = this.bgPopupNode.height;
 const difference = 550 - contentHeight;
 for (let i = 0; i < 30; i++) {
    const delay = cc.delayTime(0.1);
    const newHeight = contentHeight + (difference / 30) * (i + 1);
    actions.push(
      delay,
      cc.callFunc(() => {
        this.bgPopupNode.height = newHeight;
      }),
    );
  }
  this.bgPopupNode.stopAllActions();
  this.bgPopupNode.runAction(cc.sequence(actions).easing(cc.easeSineOut()));
cc.tween(this.bgPopupNode)
            .to(3, {height: 550}, {easing: "sineOut"})
            .start()
1 Like