Hello.
I am trying to create a duck hunt game via QT creator.
So i need some help.
I have user interface (background some picture) and now i need to create object ( animated GIF duck flying) <- i dunno how to do this , then to make it show on user interface ( background ) <- also this | and the most important thing i have to make that object move via X axis. ( from 0 to 700 ) and the most important part is that, that i have to make the movement visible -> i want to see moving object via X axis. Also the duck must appear somewhere in Y axis ( from 0 to 100 ) it has to be random appearing and hard thing that the more time pass, the more ducks have to appear in different places on Y axis ant move via X axis.
Any help is appreciated . Very many thanks. Reply someone as soon as possible.
I have tried with this. This means to create duck object.
void CFrameWnd::SukurtiAnti()
{
// QMovie *movie = new QMovie(":/Antis/paveiksl/duck.gif");
// QLabel *processLabel = new QLabel(this);
// processLabel->setMovie(movie);
// movie->start();
// antis->setStyleSheet("background-image: url(:/Antis/paveiksl/duck.gif)");
ui->gridLayout->addWidget(antis);
ui->gridLayout->addWidget(button);
button->setGeometry(20,20,20,20);
button->setStyleSheet("background-image: url(:/Antis/paveiksl/duck.gif)");
antis->show();
}
void CFrameWnd::SukurtiAnti()
{
// QMovie *movie = new QMovie(":/Antis/paveiksl/duck.gif");
// QLabel *processLabel = new QLabel(this);
// processLabel->setMovie(movie);
// movie->start();
QWidget *antis = new QWidget(this);
// antis->setStyleSheet("background-image: url(:/Antis/paveiksl/duck.gif)");
ui->gridLayout->addWidget(antis);
QPushButton *button = new QPushButton("one");
ui->gridLayout->addWidget(button);
button->setGeometry(20,20,20,20);
button->setStyleSheet("background-image: url(:/Antis/paveiksl/duck.gif)");
antis->show();
}
To copy to clipboard, switch view to plain text mode
First of all i try to create new widget antis then new layout is created to make duck visible on background ( but there isn't and i don't know why) . i tried to make animated gif with movie, but the picture is not shown ... i also tried to create pushbutton but there is no results at all.. So help me with any replies.
Regards Audrius
Bookmarks