void Viewport::setYOffset(float yOffset) { yOffset = qBound<float>(0.0f, yOffset, m_maxYOffset); if (m_yOffset != yOffset) { m_yOffset = yOffset; if (m_scene) { m_yGroupAnimation->clear(); QPropertyAnimation *yAnim = new QPropertyAnimation(m_scene, "y"); yAnim->setDuration(m_animationDuration); // TODO set duration according the offset value yAnim->setEasingCurve(m_animationEasingCurve); yAnim->setStartValue(m_scene->y()); yAnim->setEndValue(-m_yOffset); m_yGroupAnimation->addAnimation(yAnim); /* TODO: Fix this according to current layer scheme QPropertyAnimation *yLayerAnimation = new QPropertyAnimation(m_scene->gameLayers(), "yOffset"); // TODO yLayerAnimation->setDuration(m_animationDuration); // TODO yLayerAnimation->setEasingCurve(m_animationEasingCurve); yLayerAnimation->setStartValue(m_scene->gameLayers()->yOffset()); yLayerAnimation->setEndValue(m_yOffset); m_yGroupAnimation->addAnimation(yLayerAnimation); */ m_yGroupAnimation->start(); } emit yOffsetChanged(); } }
void popupWindow::setYOffset(int offset) { if(m_yOffset != offset) { m_yOffset = offset; updateSize(); emit yOffsetChanged(); } }
void GameLayers::setYOffset(const qreal &yOffset) { if (m_yOffset != yOffset) { m_yOffset = yOffset; emit yOffsetChanged(); } }
void ShadowEffect::setYOffset(qreal value) { if (qFuzzyCompare(m_yOffset, value)) { return; } m_yOffset = value; m_shadow = QImage(); updateBoundingRect(); yOffsetChanged(m_yOffset); }
void Viewport::setYOffset(float yOffset) { yOffset = yOffset > m_maxYOffset ? m_maxYOffset : yOffset; if (yOffset < 0.0f) yOffset = 0.0f; if (m_yOffset != yOffset) { m_yOffset = yOffset; if (m_scene) m_scene->setY(-m_yOffset); emit yOffsetChanged(); } }
GameLayers::GameLayers(GameScene *parent) : GameItem(parent) , m_tileWidth(32) , m_tileHeight(32) , m_totalColumns(0) , m_drawType(Quasi::TiledDrawType) , m_xOffset(0) , m_yOffset(0) { connect(this, SIGNAL(xOffsetChanged()), this, SLOT(changeXOffset())); connect(this, SIGNAL(yOffsetChanged()), this, SLOT(changeYOffset())); // control variables m_drawGrid = false; m_gridColor = Qt::red; }