aboutsummaryrefslogtreecommitdiff
path: root/src/MenuScene.cpp
diff options
context:
space:
mode:
authorSamu Laaksonen <laaksonen.sj@gmail.com>2012-09-29 22:21:14 +0300
committerSamu Laaksonen <laaksonen.sj@gmail.com>2012-09-29 22:21:14 +0300
commita8934f323fd7e48014addb55ff25ef0486aebbd1 (patch)
tree914cd44e012f498b0d1fc610659049085f8b7a11 /src/MenuScene.cpp
parent87618947d1de7cdd1ff9a8047acec3279ef253b4 (diff)
downloadprism-a8934f323fd7e48014addb55ff25ef0486aebbd1.tar.gz
prism-a8934f323fd7e48014addb55ff25ef0486aebbd1.zip
MenuScene changes
Changed MenuScene to use buttons based on new AnimatingUiElement - buttons now have scale animation allowing them to be a bit more "lively" Added hero_concept as png ":D"
Diffstat (limited to 'src/MenuScene.cpp')
-rw-r--r--src/MenuScene.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/MenuScene.cpp b/src/MenuScene.cpp
index 241f423..a7c2a75 100644
--- a/src/MenuScene.cpp
+++ b/src/MenuScene.cpp
@@ -4,6 +4,8 @@
#include "GraphicsButtonObject.h"
#include "GameView.h"
+#include "AnimatingUiElement.h"
+
#include "MenuScene.h"
MenuScene::MenuScene(const QString &name, const QRectF &rect, GameView *parent)
@@ -40,6 +42,30 @@ void MenuScene::initializeScene()
{
int yoff = 200;
+ AnimatingUiElement *btn1 = new AnimatingUiElement("Play");
+
+ btn1->setOffset(-btn1->boundingRect().width() / 2,
+ -btn1->boundingRect().height() / 2);
+ btn1->setPos(sceneRect().width() / 2, yoff);
+ addItem(btn1);
+
+ AnimatingUiElement *btn2 = new AnimatingUiElement("Credits");
+ btn2->setOffset(-btn2->boundingRect().width() / 2,
+ -btn2->boundingRect().height() / 2);
+ btn2->setPos(sceneRect().width() / 2, btn1->pos().y() + btn1->boundingRect().height() + 20);
+ addItem(btn2);
+
+ AnimatingUiElement *btn3 = new AnimatingUiElement("Quit");
+ btn3->setOffset(-btn3->boundingRect().width() / 2,
+ -btn3->boundingRect().height() / 2);
+ btn3->setPos(sceneRect().width() / 2, btn2->pos().y() + btn2->boundingRect().height() + 20);
+ addItem(btn3);
+
+ connect(btn1, SIGNAL(clicked()), gameView(), SLOT(showLevelSelectionScene()));
+ connect(btn2, SIGNAL(clicked()), gameView(), SLOT(showCreditsScene()));
+ connect(btn3, SIGNAL(clicked()), qApp, SLOT(quit()));
+
+ /*
GraphicsButtonObject *btn1 = new GraphicsButtonObject("Play", 0, this);
btn1->setPos(260, yoff);
@@ -52,6 +78,7 @@ void MenuScene::initializeScene()
connect(btn1, SIGNAL(clicked()), gameView(), SLOT(showLevelSelectionScene()));
connect(btn2, SIGNAL(clicked()), gameView(), SLOT(showCreditsScene()));
connect(btn3, SIGNAL(clicked()), qApp, SLOT(quit()));
+ */
addTitle("prism");
}