void MyCardsPixmapLabel::startFlipCards(int speed, const QPixmap &frontPix, const QPixmap &flipsidePix)
{

	stopFadeOut();

	stopFlipCards = FALSE;
	isFlipside = FALSE;

	QLabel::setPixmap(frontPix);

	frameFlipCardsAction1Size = 1.0;
	frameFlipCardsAction2Size = 0.0;

	front = frontPix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
	flipside = flipsidePix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;

	if(speed <= 4) {
		flipCardsScaleIntervall = 0.1;
	}
	if(speed > 4 && speed <= 6) {
		flipCardsScaleIntervall = 0.20;
	}
	if(speed > 6 && speed <= 8) {
		flipCardsScaleIntervall = 0.25;
	}
	if(speed > 8 && speed <= 10) {
		flipCardsScaleIntervall = 0.5;
	}

	if(speed != 11) {
		flipCardsAction1 = TRUE;
		flipCardsTimer->start(40);
	}

}
Exemple #2
0
    void GuiManager::updateFadeOut()
    {
        if(mFadeValue >= 255.0f || mFadeCurrentDocument == NULL)
        {
            stopFadeOut();
            return;
        }

        mFadeValue += mFadeDelta;
        auto element = mFadeCurrentDocument->GetElementById("fade");
        if(element)
        {
            auto value = std::to_string(int(mFadeValue));
            auto rgba = "rgba(0,0,0," + value + ")";
            element->SetProperty("background-color", rgba.c_str() );
        }
    }