aboutsummaryrefslogtreecommitdiff
path: root/src/LevelSelectionScene.cpp
diff options
context:
space:
mode:
authorSamu Laaksonen <laaksonen.sj@gmail.com>2012-09-28 22:36:58 +0300
committerSamu Laaksonen <laaksonen.sj@gmail.com>2012-09-28 22:36:58 +0300
commit1cf5a427a829b22abea7027b18a130a01da3ed6a (patch)
tree9076e816e052bb35e52890a13562844090312be5 /src/LevelSelectionScene.cpp
parent685fe05def77b039221edf06c74af74915d536c5 (diff)
downloadprism-1cf5a427a829b22abea7027b18a130a01da3ed6a.tar.gz
prism-1cf5a427a829b22abea7027b18a130a01da3ed6a.zip
Rename commit
Renamed some files according the project name Added base directory structure for resources Changed more fitting parallax scrolled background to menus - added 3 new layers as resources Changed more cheerful buttons to menus Added base classes to build HUD later on Added one new test level that is size of 800*480 with tilesize of 32*32
Diffstat (limited to 'src/LevelSelectionScene.cpp')
-rw-r--r--src/LevelSelectionScene.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/LevelSelectionScene.cpp b/src/LevelSelectionScene.cpp
index 02516b1..aa6c607 100644
--- a/src/LevelSelectionScene.cpp
+++ b/src/LevelSelectionScene.cpp
@@ -19,8 +19,12 @@ LevelSelectionScene::LevelSelectionScene(const QString &name, const QRectF &rect
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 + "/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();
}
@@ -36,7 +40,11 @@ void LevelSelectionScene::initializeScene()
QSettings settings;
- QDir levelDirectory(settings.value("path/levels").toString());
+ QString path = qApp->applicationDirPath() + "/data/levels";
+
+ //QDir levelDirectory(settings.value("path/levels").toString());
+
+ QDir levelDirectory(path);
/* TODO: check levels directory for levels (should be 6) and create corresponding buttons
that react when pressed and lauch the level
@@ -69,8 +77,8 @@ void LevelSelectionScene::initializeScene()
}
GraphicsButtonObject *btn;
- btn = new GraphicsButtonObject(QPixmap(QApplication::applicationDirPath() + "/gfx/buttons/back-arrow1.png"), 0, this);
- btn->setPressedPixmap(QPixmap(QApplication::applicationDirPath() + "/gfx/buttons/back-arrow2.png"));
+ btn = new GraphicsButtonObject(QPixmap(QApplication::applicationDirPath() + "/data/gfx/buttons/back-arrow1.png"), 0, this);
+ btn->setPressedPixmap(QPixmap(QApplication::applicationDirPath() + "/data/gfx/buttons/back-arrow2.png"));
btn->setPos(720, 400);
btn->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
btn->setZValue(2);