aboutsummaryrefslogtreecommitdiff
path: root/src/ActionScene.cpp
diff options
context:
space:
mode:
authorSamu Laaksonen <laaksonen.sj@gmail.com>2012-10-21 15:46:32 +0300
committerSamu Laaksonen <laaksonen.sj@gmail.com>2012-10-21 15:46:32 +0300
commit9674c5ea91912d07f4726140ca2c88669c03f874 (patch)
tree3b48d5e812b02fb2bfa581856e0b42bbeafe4fbf /src/ActionScene.cpp
parentfe15901cad4ccc90b5702cf5061849c1ab1fd40d (diff)
downloadprism-9674c5ea91912d07f4726140ca2c88669c03f874.tar.gz
prism-9674c5ea91912d07f4726140ca2c88669c03f874.zip
HUD demo
Added: - some ideas to test display of hud elements Fixed: - HUD now follows the scene when it moves
Diffstat (limited to 'src/ActionScene.cpp')
-rw-r--r--src/ActionScene.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ActionScene.cpp b/src/ActionScene.cpp
index 8c6d374..c10bcf6 100644
--- a/src/ActionScene.cpp
+++ b/src/ActionScene.cpp
@@ -113,7 +113,11 @@ void ActionScene::keyPressEvent(QKeyEvent *event)
// button d
case 68 :
break;
+ case 16777216 :
+ gameView()->changeScene(gameView()->getScene("LevelSelectionScene"));
+ break;
default:
+ qDebug() << event->key();
break;
}
}
@@ -125,7 +129,7 @@ void ActionScene::drawBackground(QPainter *painter, const QRectF &rect)
void ActionScene::drawForeground(QPainter *painter, const QRectF &rect)
{
- painter->drawPixmap(0, 0, width(), height(), *m_hud);
+ painter->drawPixmap(rect.x(), rect.y(), sceneRect().width(), sceneRect().height(), *m_hud);
}
void ActionScene::loadMap(QString target)