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());
Qt平移动画
最新推荐文章于 2025-02-27 14:39:45 发布