当前位置:   article > 正文

Qt平移动画

qt平移动画
void Pokemon::moveTo(int x, int y)
{
   
    /*
    stop();
    state = MOVE;
    qreal distance = sqrt(pow(x - this->x(), 2) + pow(x - this->y(), 2));
    if (x - this->x() > 0)
        direct = RIGHT;
    else
        direct = LEFT;
    int timeLength = static_cast<int>(distance / speed);
    if (timeLine)
        delete timeLine;
    timeLine = new QTimeLine(timeLength);
    timeLine->setCurveShape(QTimeLine::EaseInOutCurve);
    animation->setTimeLine(timeLine);
    animation->setTranslationAt(1, x - this->x(), y - this->y());
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/843920
推荐阅读
相关标签
  

闽ICP备14008679号