Select one of the symbols to view example projects that use it.
 
Outline
#define GAME_2048_VIEW_HPP
#include <gui/common/DemoView.hpp>
#include <gui/game2048_screen/Game2048Presenter.hpp>
#include <touchgfx/widgets/Image.hpp>
#include <touchgfx/widgets/TextAreaWithWildcard.hpp>
#include <touchgfx/widgets/Box.hpp>
#include <touchgfx/widgets/Button.hpp>
#include <touchgfx/widgets/ToggleButton.hpp>
#include <touchgfx/mixins/MoveAnimator.hpp>
#include <touchgfx/mixins/FadeAnimator.hpp>
#include <gui/game2048_screen/GameBoard.hpp>
#include <touchgfx/mixins/FadeAnimator.hpp>
#include <touchgfx/mixins/MoveAnimator.hpp>
#include <gui/common/SwipeContainer.hpp>
#include <touchgfx/containers/ListLayout.hpp>
Game2048View
Files
loading...
CodeScopeSTM32 Libraries and SamplesTouchGFXGui/gui/include/gui/game2048_screen/Game2048View.hpp
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * This file is part of the TouchGFX 4.10.0 distribution. * * @attention * * Copyright (c) 2018 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ #ifndef GAME_2048_VIEW_HPP #define GAME_2048_VIEW_HPP #include <gui/common/DemoView.hpp> #include <gui/game2048_screen/Game2048Presenter.hpp> #include <touchgfx/widgets/Image.hpp> #include <touchgfx/widgets/TextAreaWithWildcard.hpp> #include <touchgfx/widgets/Box.hpp> #include <touchgfx/widgets/Button.hpp> #include <touchgfx/widgets/ToggleButton.hpp> #include <touchgfx/mixins/MoveAnimator.hpp> #include <touchgfx/mixins/FadeAnimator.hpp> #include <gui/game2048_screen/GameBoard.hpp> #include <touchgfx/mixins/FadeAnimator.hpp> #include <touchgfx/mixins/MoveAnimator.hpp> #include <gui/common/SwipeContainer.hpp> #include <touchgfx/containers/ListLayout.hpp> 14 includes class Game2048View : public DemoView<Game2048Presenter> { public: Game2048View(); virtual ~Game2048View(); virtual void setupScreen(); virtual void tearDownScreen(); virtual void screenSaverMinorTick(); public: private: static const int NUMBER_OF_INSTRUCTIONS = 3; Image background; GameBoard gameBoard; int currentScore; TextAreaWithOneWildcard scoreTxt; Unicode::UnicodeChar scoreTxtbuf[10]; FadeAnimator<MoveAnimator<TextAreaWithOneWildcard> > deltaScoreTxt; Unicode::UnicodeChar deltaScoreTxtbuf[10]; Button newGameButton; ToggleButton autoPlayButton; Button howToPlayButton; Box overlay; Image popUp; SwipeContainer howToPlayInstructionContainer; Container howToPlayInstructionExtraSpaceContainer[NUMBER_OF_INSTRUCTIONS]; Image howToPlayInstruction[NUMBER_OF_INSTRUCTIONS]; Button closeHowToPlayButton; Image endGameStatus; Callback<Game2048View, const GameBoard& > moveCompletedCallback; Callback<Game2048View, const GameBoard& > gameWonCallback; Callback<Game2048View, const GameBoard& > gameLostCallback; Callback<Game2048View, const AbstractButton& > buttonPressedCallback; void moveCompletedHandler(const GameBoard& gb); void gameWonHandler(const GameBoard& gb); void gameLostHandler(const GameBoard& gb); void buttonPressedHandler(const AbstractButton& button); void updateScoreText(); void showDeltaScoreText(int deltaScore); void showHowToPlayPopUp(bool visible); void startNewGame();private: ...}; /* ... */ #endif // GAME_2048_VIEW_HPP