• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

granatier

  • sources
  • kde-4.14
  • kdegames
  • granatier
  • src
infooverlay.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009 Mathias Kraus <k.hias@gmx.de>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INFOOVERLAY_H
19 #define INFOOVERLAY_H
20 
21 #include <QObject>
22 #include <QMap>
23 #include <QList>
24 
25 class QGraphicsTextItem;
26 class QGraphicsRectItem;
27 class Game;
28 class GameScene;
29 class Player;
30 class KGameRenderedItem;
31 
35 class InfoOverlay : public QObject
36 {
37  Q_OBJECT
38 
39 private:
40  GameScene* m_gameScene;
41  Game* m_game;
42 
43  QMap <Player*, QList<KGameRenderedItem*> > m_mapScore;
44  QMap <Player*, QGraphicsTextItem*> m_mapPlayerNames;
45  QGraphicsTextItem* m_continueLabel;
46  QGraphicsTextItem* m_newGameLabel;
47  QGraphicsTextItem* m_gameOverLabel;
48 
49  QGraphicsTextItem* m_getReadyLabel;
50  QGraphicsTextItem* m_startGameLabel;
51 
52  QGraphicsTextItem* m_pauseLabel;
53  QGraphicsTextItem* m_continueAfterPauseLabel;
54 
55  QGraphicsRectItem* m_dimmOverlay;
56 
57  qreal m_svgScaleFactor;
58 
59 public:
60 
66  InfoOverlay (Game* p_game, GameScene* p_scene);
67 
71  ~InfoOverlay();
72 
76  void showGetReady();
77 
81  void showPause();
82 
86  void showScore();
87 
91  void hideItems();
92 
100  void resizeDimmOverlay(qreal x, qreal y, qreal width, qreal height);
101 
105  void themeChanged();
106 
107 public slots:
112  virtual void updateGraphics(qreal svgScaleFactor);
113 };
114 
115 #endif
116 
QMap
InfoOverlay
This class the game info if paused or a round is over.
Definition: infooverlay.h:35
QObject
InfoOverlay::resizeDimmOverlay
void resizeDimmOverlay(qreal x, qreal y, qreal width, qreal height)
Resize dimm overlay.
Definition: infooverlay.cpp:303
Game
This class manages the game main loop : it regularly checks the key press events, computes the charac...
Definition: game.h:43
QGraphicsTextItem
InfoOverlay::showScore
void showScore()
Shows the score info.
Definition: infooverlay.cpp:175
InfoOverlay::hideItems
void hideItems()
Hides the info items.
Definition: infooverlay.cpp:237
InfoOverlay::InfoOverlay
InfoOverlay(Game *p_game, GameScene *p_scene)
Creates a new InfoOverlay instance.
Definition: infooverlay.cpp:31
QGraphicsRectItem
InfoOverlay::showGetReady
void showGetReady()
Shows the get ready info.
Definition: infooverlay.cpp:135
InfoOverlay::showPause
void showPause()
Shows the pause info.
Definition: infooverlay.cpp:155
GameScene
This class contains all the Game elements to be drawn on the screen by the GameView instance...
Definition: gamescene.h:50
KGameRenderedItem
InfoOverlay::~InfoOverlay
~InfoOverlay()
Deletes the InfoOverlay instance.
Definition: infooverlay.cpp:110
InfoOverlay::updateGraphics
virtual void updateGraphics(qreal svgScaleFactor)
Updates the graphics after a resize.
Definition: infooverlay.cpp:308
Player
This class represents the main character of the game.
Definition: player.h:33
InfoOverlay::themeChanged
void themeChanged()
Handles theme changes.
Definition: infooverlay.cpp:388
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

granatier

Skip menu "granatier"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal