F746 GUI other class.

Dependents:   DISCO-F746NG_test001

Committer:
InoueTakashi
Date:
Fri Jun 24 01:20:07 2016 +0000
Revision:
0:944b36823ef2
Child:
1:c77f45e79881
F746 GUI other library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
InoueTakashi 0:944b36823ef2 1 //
InoueTakashi 0:944b36823ef2 2 // 2016/04/27, Copyright (c) 2016 Takashi Inoue
InoueTakashi 0:944b36823ef2 3 // GUI 用定数
InoueTakashi 0:944b36823ef2 4 // ver 0.9 rev 0.1 2016/4/27
InoueTakashi 0:944b36823ef2 5 //-----------------------------------------------------------
InoueTakashi 0:944b36823ef2 6
InoueTakashi 0:944b36823ef2 7 #ifndef F746_GUI_CONST_HPP
InoueTakashi 0:944b36823ef2 8 #define F746_GUI_CONST_HPP
InoueTakashi 0:944b36823ef2 9
InoueTakashi 0:944b36823ef2 10 #include "stm32746g_discovery_lcd.h"
InoueTakashi 0:944b36823ef2 11 #include "Circle.hpp"
InoueTakashi 0:944b36823ef2 12 #include "GuiBase.hpp"
InoueTakashi 0:944b36823ef2 13
InoueTakashi 0:944b36823ef2 14 namespace TakaIno
InoueTakashi 0:944b36823ef2 15 {
InoueTakashi 0:944b36823ef2 16 //---- Label constant variables ----
InoueTakashi 0:944b36823ef2 17 //作業1: メインタイトルの文字を変えてみましょう 30文字以内
InoueTakashi 0:944b36823ef2 18
InoueTakashi 0:944b36823ef2 19 const string GUI_MAIN_TITLE = ">>> Baloon touch! Game <<<"; //メインタイトル
InoueTakashi 0:944b36823ef2 20
InoueTakashi 0:944b36823ef2 21 //---- Button constant variables ----
InoueTakashi 0:944b36823ef2 22 const int GUI_NUMBER_BUTTONS = 4; //使用ボタンの数
InoueTakashi 0:944b36823ef2 23 //ボタン上に表示する文字列
InoueTakashi 0:944b36823ef2 24 const string GUI_BTN_STR1[GUI_NUMBER_BUTTONS] = {"Start", "End", "none",
InoueTakashi 0:944b36823ef2 25 "none"
InoueTakashi 0:944b36823ef2 26 };
InoueTakashi 0:944b36823ef2 27 const uint16_t GUI_BTN_X_POS = 425; //ボタングループ(Button Group)の最初のX座標
InoueTakashi 0:944b36823ef2 28 const uint16_t GUI_BTN_Y_POS = 0; //ボタングループの最初のY座標
InoueTakashi 0:944b36823ef2 29 const uint16_t GUI_BTN_WIDTH = 55; //ボタンの幅
InoueTakashi 0:944b36823ef2 30 const uint16_t GUI_BTN_HIGHT = 40; //ボタンの高さ
InoueTakashi 0:944b36823ef2 31
InoueTakashi 0:944b36823ef2 32 const uint16_t GUI_BTN_X_SPACE = 5; //ボタン同士のX方向のすきま
InoueTakashi 0:944b36823ef2 33 const uint16_t GUI_BTN_Y_SPACE = 5; //ボタン同士のYX方向のすき
InoueTakashi 0:944b36823ef2 34
InoueTakashi 0:944b36823ef2 35 const uint16_t GUI_BTN_COLUMN = 1; //ボタンマトリクスの列の数
InoueTakashi 0:944b36823ef2 36
InoueTakashi 0:944b36823ef2 37 const uint16_t GUI_FIRST_BTN_NUM = 0; //最初のボタン番号
InoueTakashi 0:944b36823ef2 38
InoueTakashi 0:944b36823ef2 39 const uint32_t GUI_BTN_BACK_COL = LCD_COLOR_GREEN; //ボタンが押された後の背景色
InoueTakashi 0:944b36823ef2 40
InoueTakashi 0:944b36823ef2 41 //作業2: どの円をタッチしても加点するようにしましょう
InoueTakashi 0:944b36823ef2 42
InoueTakashi 0:944b36823ef2 43 const int GUI_ADD_POINT1 = 10; //ゲームの加点1
InoueTakashi 0:944b36823ef2 44 const int GUI_ADD_POINT2 = 20; //ゲームの加点2
InoueTakashi 0:944b36823ef2 45 const int GUI_DEME_POINT = -15; //ゲームの減点
InoueTakashi 0:944b36823ef2 46
InoueTakashi 0:944b36823ef2 47 //---- Circle constant variables ----
InoueTakashi 0:944b36823ef2 48 //作業3: 表示する円の数を変えてみましょう 1~7
InoueTakashi 0:944b36823ef2 49
InoueTakashi 0:944b36823ef2 50 const int GUI_CIRCLE_MAX = 7; //表示する円の数
InoueTakashi 0:944b36823ef2 51
InoueTakashi 0:944b36823ef2 52 //作業4: 円に表示する文字を変えてみましょう 4文字以内
InoueTakashi 0:944b36823ef2 53
InoueTakashi 0:944b36823ef2 54 //表示する円の詳細な設定値
InoueTakashi 0:944b36823ef2 55 /* X座標、Y座標、半径、表の表示色、裏の表示色、円を動かすフラグ、
InoueTakashi 0:944b36823ef2 56 動かすときのX方向の変位、動かすときのY方向の変位、文字を表示するフラグ、文字表示色
InoueTakashi 0:944b36823ef2 57 {表の表示文字、裏の表示文字}、フォント、LCDの横幅 */
InoueTakashi 0:944b36823ef2 58
InoueTakashi 0:944b36823ef2 59 const struct Circle::CircleInfo DEF_CIR_INFO[ 7 ] = {
InoueTakashi 0:944b36823ef2 60 {50,50,35, LCD_COLOR_RED, LCD_COLOR_DARKBLUE,
InoueTakashi 0:944b36823ef2 61 false,-1,-1,true, LCD_COLOR_WHITE, 0, {"ABC", "ACb"}, &Font12, 480},
InoueTakashi 0:944b36823ef2 62 {80,60,45, LCD_COLOR_ORANGE, LCD_COLOR_GRAY,
InoueTakashi 0:944b36823ef2 63 false,-1,1,true, LCD_COLOR_WHITE, 0, {"AbC","AcB"}, &Font12, 480},
InoueTakashi 0:944b36823ef2 64 {120,70,35, LCD_COLOR_YELLOW, LCD_COLOR_CYAN,
InoueTakashi 0:944b36823ef2 65 false,1,-1,true, LCD_COLOR_WHITE, 0, {"Abe","AKb"}, &Font12, 480},
InoueTakashi 0:944b36823ef2 66 {150,80,45, LCD_COLOR_GREEN, LCD_COLOR_DARKRED,
InoueTakashi 0:944b36823ef2 67 false,-2,1,true, LCD_COLOR_WHITE, 0, {"AKB","ABk"}, &Font12, 480},
InoueTakashi 0:944b36823ef2 68 {200,90,35, LCD_COLOR_BROWN, LCD_COLOR_DARKCYAN,
InoueTakashi 0:944b36823ef2 69 false,1,-2,true, LCD_COLOR_WHITE, 0, {"Acb", "ACb"},&Font12, 480},
InoueTakashi 0:944b36823ef2 70 {200,100,45, LCD_COLOR_ORANGE, LCD_COLOR_DARKGREEN,
InoueTakashi 0:944b36823ef2 71 false,2,1,true, LCD_COLOR_WHITE, 0, {"ABc","aBC"}, &Font12, 480},
InoueTakashi 0:944b36823ef2 72 {100,100,35, LCD_COLOR_DARKRED, LCD_COLOR_GRAY,
InoueTakashi 0:944b36823ef2 73 false,2,2,true, LCD_COLOR_RED, 0, {"Abk","ABe"}, &Font12, 480}
InoueTakashi 0:944b36823ef2 74 };
InoueTakashi 0:944b36823ef2 75
InoueTakashi 0:944b36823ef2 76 }
InoueTakashi 0:944b36823ef2 77 #endif //F746_GUI_CONST_HPP
InoueTakashi 0:944b36823ef2 78
InoueTakashi 0:944b36823ef2 79
InoueTakashi 0:944b36823ef2 80
InoueTakashi 0:944b36823ef2 81
InoueTakashi 0:944b36823ef2 82
InoueTakashi 0:944b36823ef2 83