diff options
| author | Samu Laaksonen <laaksonen.sj@gmail.com> | 2012-12-10 23:47:03 +0200 |
|---|---|---|
| committer | Samu Laaksonen <laaksonen.sj@gmail.com> | 2012-12-10 23:47:03 +0200 |
| commit | ad19e537066742e1a5f9bbb8c3549a47480a33c1 (patch) | |
| tree | 2f48c08f22bea31756f784495d3c50cd9736e889 /src/CreditsScene.cpp | |
| parent | 9674c5ea91912d07f4726140ca2c88669c03f874 (diff) | |
| download | prism-ad19e537066742e1a5f9bbb8c3549a47480a33c1.tar.gz prism-ad19e537066742e1a5f9bbb8c3549a47480a33c1.zip | |
Box2d integration
Very crude and buggy
Needs to be much better
Diffstat (limited to 'src/CreditsScene.cpp')
| -rw-r--r-- | src/CreditsScene.cpp | 136 |
1 files changed, 67 insertions, 69 deletions
diff --git a/src/CreditsScene.cpp b/src/CreditsScene.cpp index edcee8f..65f77fc 100644 --- a/src/CreditsScene.cpp +++ b/src/CreditsScene.cpp @@ -1,69 +1,67 @@ -#include <QApplication> -#include <QGraphicsTextItem> - -#include <QDebug> - -#include "GameView.h" -#include "GraphicsButtonObject.h" -#include "ParallaxScrollerStatic.h" - -#include "CreditsScene.h" - -CreditsScene::CreditsScene(const QString &name, const QRectF &rect, GameView *parent) - : GameScene(name, parent) -{ - setSceneRect(rect); - - QString appDir = qApp->applicationDirPath(); - - m_background = new ParallaxScrollerStatic(this); - m_background->setLayerWidth(rect.width()); - //m_background->addParallaxScrollItem(QString(appDir + "/gfx/bg/layer1.png"), QPointF(0,0), -2, 6); - //m_background->addParallaxScrollItem(QString(appDir + "/gfx/bg/layer2.png"), QPointF(0,0), -1, 4); - - m_background->addParallaxScrollItem(QString(appDir + "/data/gfx/background/layer_three.png"), QPointF(0,0), -3, 8); - m_background->addParallaxScrollItem(QString(appDir + "/data/gfx/background/layer_two.png"), QPointF(0,0), -2, 6); - m_background->addParallaxScrollItem(QString(appDir + "/data/gfx/background/layer_one.png"), QPointF(0,0), -1, 4); - - initializeScene(); -} - -CreditsScene::~CreditsScene() -{ - delete m_background; -} - -void CreditsScene::initializeScene() -{ - addTitle("Credits"); - - QGraphicsTextItem* creditText = new QGraphicsTextItem(0, this); - creditText->setHtml("<font color=\"white\">"\ - "<b>prism</b> (v. 0.0.3) <br><br>"\ - "Game design,<br>"\ - "concept design and<br>"\ - "programming by:<br>"\ - "Samu Laaksonen<br>"\ - "and <br>"\ - "Oskari Timperi<br><br>"\ - "Copyright (c) 2012 of aforementioned persons. All rights reserved.<br>"\ - "</font>"); - creditText->setPos(140, 130); - creditText->setFont(QFont("Arial", 14)); - - GraphicsButtonObject *btn; - btn = new GraphicsButtonObject(QPixmap(qApp->applicationDirPath() + "/data/gfx/buttons/back-arrow1.png"), - 0, this); - btn->setPressedPixmap(QPixmap(qApp->applicationDirPath() + "/data/gfx/buttons/back-arrow2.png")); - btn->setPos(720, 400); - btn->setShapeMode(QGraphicsPixmapItem::BoundingRectShape); - btn->setZValue(2); - - connect(btn, SIGNAL(clicked()), gameView(), SLOT(showMenuScene())); -} - -void CreditsScene::updateLogic() -{ - advance(); - update(); -} +#include <QApplication>
+#include <QGraphicsTextItem>
+
+#include <QDebug>
+
+#include "GameView.h"
+#include "GraphicsButtonObject.h"
+#include "ParallaxScrollerStatic.h"
+
+#include "CreditsScene.h"
+
+CreditsScene::CreditsScene(const QString &name, const QRectF &rect, GameView *parent)
+ : GameScene(name, parent)
+{
+ setSceneRect(rect);
+
+ QString appDir = qApp->applicationDirPath();
+
+ m_background = new ParallaxScrollerStatic(this);
+ m_background->setLayerWidth(rect.width());
+
+ m_background->addParallaxScrollItem(QString(appDir + "/data/gfx/background/layer_three.png"), QPointF(0,0), -3, 8);
+ m_background->addParallaxScrollItem(QString(appDir + "/data/gfx/background/layer_two.png"), QPointF(0,0), -2, 6);
+ m_background->addParallaxScrollItem(QString(appDir + "/data/gfx/background/layer_one.png"), QPointF(0,0), -1, 4);
+
+ initializeScene();
+}
+
+CreditsScene::~CreditsScene()
+{
+ delete m_background;
+}
+
+void CreditsScene::initializeScene()
+{
+ addTitle("Credits");
+
+ QGraphicsTextItem* creditText = new QGraphicsTextItem(0, this);
+ creditText->setHtml("<font color=\"white\">"\
+ "<b>prism</b> (v. 0.0.3) <br><br>"\
+ "Game design,<br>"\
+ "concept design and<br>"\
+ "programming by:<br>"\
+ "Samu Laaksonen<br>"\
+ "and <br>"\
+ "Oskari Timperi<br><br>"\
+ "Copyright (c) 2012 of aforementioned persons. All rights reserved.<br>"\
+ "</font>");
+ creditText->setPos(140, 130);
+ creditText->setFont(QFont("Arial", 14));
+
+ GraphicsButtonObject *btn;
+ btn = new GraphicsButtonObject(QPixmap(qApp->applicationDirPath() + "/data/gfx/buttons/back-arrow.png"),
+ 0, this);
+ btn->setPressedPixmap(QPixmap(qApp->applicationDirPath() + "/data/gfx/buttons/back-arrow-pressed.png"));
+ btn->setPos(720, 400);
+ btn->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
+ btn->setZValue(2);
+
+ connect(btn, SIGNAL(clicked()), gameView(), SLOT(showMenuScene()));
+}
+
+void CreditsScene::updateLogic()
+{
+ advance();
+ update();
+}
|
