• R/O
  • SSH

hyakutyping: コミット

ゲーム用のソースコード


コミットメタ情報

リビジョン6e2476dbf9c6664e211e199cf7b289229ff4f6eb (tree)
日時2011-05-15 21:36:33
作者satofumi
コミッターsatofumi

ログメッセージ

オプション画面に GUI コンポーネントを配置。操作まわりの調整はまだ

変更サマリ

差分

diff -r e604d36a482a -r 6e2476dbf9c6 scripts/first_menu.lua
--- a/scripts/first_menu.lua Sat May 07 17:22:27 2011 +0900
+++ b/scripts/first_menu.lua Sun May 15 21:36:33 2011 +0900
@@ -126,10 +126,10 @@
126126 end
127127
128128 -- メニューで選択された状態へ遷移させる
129- if menu_:isClicked() then
130- --if true then
131- selected_index_ = menu_:clickedId()
132- --selected_index_ = 3
129+ --if menu_:isClicked() then
130+ if true then
131+ --selected_index_ = menu_:clickedId()
132+ selected_index_ = 3
133133
134134 if selected_index_ == 1 then
135135 require("practice_menu")
diff -r e604d36a482a -r 6e2476dbf9c6 scripts/option_config.lua
--- a/scripts/option_config.lua Sat May 07 17:22:27 2011 +0900
+++ b/scripts/option_config.lua Sun May 15 21:36:33 2011 +0900
@@ -4,6 +4,9 @@
44 -- $Id$
55
66
7+require("menu_utils")
8+
9+
710 -- state: オプション
811 option_config = {}
912
@@ -21,13 +24,26 @@
2124 local subtitle_screen_label_ = nil
2225 local subtitle_volume_ = nil
2326 local subtitle_volume_label_ = nil
24-local subtitle_yomi_ = nil
25-local subtitle_yomi_label_ = nil
27+local subtitle_volume_music_ = nil
28+local subtitle_volume_music_label_ = nil
29+local subtitle_volume_se_ = nil
30+local subtitle_volume_se_label_ = nil
2631
2732 local option_input_ = nil
2833 local option_input_buttons_ = nil
2934 local option_input_surfaces_ = nil
3035
36+local option_screen_ = nil
37+local option_screen_buttons_ = nil
38+local option_screen_surfaces_ = nil
39+
40+local volume_music_ = nil
41+local volume_music_buttons_ = nil
42+local volume_music_surfaces_ = nil
43+
44+local volume_se_ = nil
45+local volume_se_buttons_ = nil
46+local volume_se_surfaces_ = nil
3147
3248
3349 option_config["Enter"] =
@@ -37,13 +53,13 @@
3753 title_ = TextSurface(font_, "オプション")
3854 title_label_ = Label(title_)
3955 title_label_:setPosition(Point(center(title_label_,
40- screen_:rect().w / 2), 16))
56+ screen_:rect().w / 2), 32))
4157 layer_:push_front(title_label_)
4258
4359 -- サブタイトル
44- local item_x = 80
45- local item_y = 76
46- local item_height = 90
60+ local item_x = 70
61+ local item_y = 90
62+ local item_height = 100
4763 font_:setPixelSize(subtitle_font_size)
4864 subtitle_input_ = TextSurface(font_, "入力方法")
4965 subtitle_input_label_ = Label(subtitle_input_)
@@ -63,14 +79,8 @@
6379 layer_:push_front(subtitle_volume_label_)
6480 item_y = item_y + item_height * 1.3
6581
66- subtitle_yomi_ = TextSurface(font_, "詠み上げ")
67- subtitle_yomi_label_ = Label(subtitle_yomi_)
68- subtitle_yomi_label_:setPosition(Point(item_x, item_y))
69- layer_:push_front(subtitle_yomi_label_)
70- item_y = item_y + item_height
7182
7283 -- ローマ字 / かな
73- font_:setPixelSize(option_font_size)
7484 local option_input_rect = Rect(0, 0, screen_:rect().w, option_font_size)
7585 option_input_ = Menu(option_input_rect, Menu.Middle, Menu.Horizontal)
7686 local buttons_text = {
@@ -78,9 +88,8 @@
7888 "かな",
7989 }
8090 local base_rect = Rect(0, 0, 160, 35)
81- local option_x = 150
82- local option_input_y = 120
83- require("menu_utils")
91+ local option_x = 130
92+ local option_input_y = 135
8493 option_input_buttons_ = {}
8594 option_input_surfaces_ = {}
8695 createMenu(option_input_, buttons_text,
@@ -93,19 +102,82 @@
93102 option_input_:setPosition(Point(option_x, option_input_y))
94103 layer_:push_front(option_input_)
95104
96- -- !!!
97105
98106 -- フルスクリーン / ウィンドウ
99- -- !!!
107+ font_:setPixelSize(option_font_size)
108+ local option_screen_rect = Rect(0, 0, screen_:rect().w, option_font_size)
109+ option_screen_ = Menu(option_input_rect, Menu.Middle, Menu.Horizontal)
110+ buttons_text = {
111+ "フルスクリーン",
112+ "ウィンドウ",
113+ }
114+ base_rect = Rect(0, 0, 200, 35)
115+ option_x = 130
116+ local option_screen_y = 235
117+ option_screen_buttons_ = {}
118+ option_screen_surfaces_ = {}
119+ createMenu(option_screen_, buttons_text,
120+ base_rect, font_, option_screen_surfaces_,
121+ option_screen_buttons_, "center")
122+
123+ buttons_step = Point(230, 0)
124+ option_screen_:setButtonStep(buttons_step)
125+
126+ option_screen_:setPosition(Point(option_x, option_screen_y))
127+ layer_:push_front(option_screen_)
128+
100129
101130 -- 曲
102- -- !!!
131+ font_:setPixelSize(subtitle_font_size)
132+ local music_x = 120
133+ local music_y = 330
134+ subtitle_volume_music_ = TextSurface(font_, "曲")
135+ subtitle_volume_music_label_ = Label(subtitle_volume_music_)
136+ subtitle_volume_music_label_:setPosition(Point(music_x, music_y))
137+ layer_:push_front(subtitle_volume_music_label_)
103138
104139 -- 効果音
105- -- !!!
140+ local se_x = 90
141+ local se_y = 380
142+ subtitle_volume_se_ = TextSurface(font_, "効果音")
143+ subtitle_volume_se_label_ = Label(subtitle_volume_se_)
144+ subtitle_volume_se_label_:setPosition(Point(se_x, se_y))
145+ layer_:push_front(subtitle_volume_se_label_)
106146
107- -- 詠み上げリソースの項目
108- -- !!!
147+ -- 曲の音量
148+ font_:setPixelSize(option_font_size - 2)
149+ local volume_music_rect = Rect(0, 0, screen_:rect().w, option_font_size)
150+ volume_music_ = Menu(volume_music_rect, Menu.Middle, Menu.Horizontal)
151+ buttons_text = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }
152+ base_rect = Rect(0, 0, 25, 35)
153+ local volume_music_x = 190
154+ local volume_music_y = music_y
155+ volume_music_buttons_ = {}
156+ volume_music_surfaces_ = {}
157+ createMenu(volume_music_, buttons_text,
158+ base_rect, font_, volume_music_surfaces_,
159+ volume_music_buttons_, "center")
160+
161+ buttons_step = Point(32, 0)
162+ volume_music_:setButtonStep(buttons_step)
163+
164+ volume_music_:setPosition(Point(volume_music_x, volume_music_y))
165+ layer_:push_front(volume_music_)
166+
167+ -- 効果音の音量
168+ local volume_se_rect = Rect(0, 0, screen_:rect().w, option_font_size)
169+ volume_se_ = Menu(volume_se_rect, Menu.Middle, Menu.Horizontal)
170+ local volume_se_x = 190
171+ local volume_se_y = se_y
172+ volume_se_buttons_ = {}
173+ volume_se_surfaces_ = {}
174+ createMenu(volume_se_, buttons_text,
175+ base_rect, font_, volume_se_surfaces_,
176+ volume_se_buttons_, "center")
177+ volume_se_:setButtonStep(buttons_step)
178+
179+ volume_se_:setPosition(Point(volume_se_x, volume_se_y))
180+ layer_:push_front(volume_se_)
109181 end
110182
111183
@@ -129,8 +201,11 @@
129201 layer_:remove(subtitle_screen_label_)
130202 layer_:remove(subtitle_volume_label_)
131203 layer_:remove(subtitle_yomi_label_)
204+ layer_:remove(subtitle_volume_music_label_)
132205
133206 layer_:remove(option_input_)
207+ layer_:remove(option_screen_)
208+ layer_:remove(volume_music_)
134209
135210 subtitle_input_label_ = nil
136211 subtitle_input_ = nil
@@ -138,13 +213,29 @@
138213 subtitle_screen_ = nil
139214 subtitle_volume_label_ = nil
140215 subtitle_volume_ = nil
141- subtitle_yomi_label_ = nil
142- subtitle_yomi_ = nil
216+
217+ subtitle_volume_music_lable_ = nil
218+ subtitle_volume_music_ = nil
219+
220+ subtitle_volume_se_lable_ = nil
221+ subtitle_volume_se_ = nil
143222
144223 option_input_buttons_ = nil
145224 option_input_surfaces_ = nil
146225 option_input_ = nil
147226
227+ option_screen_buttons_ = nil
228+ option_screen_surfaces_ = nil
229+ option_screen_ = nil
230+
231+ volume_music_buttons_ = nil
232+ volume_music_surfaces_ = nil
233+ volume_music_ = nil
234+
235+ volume_se_buttons_ = nil
236+ volume_se_surfaces_ = nil
237+ volume_se_ = nil
238+
148239 title_label_ = nil
149240 title_ = nil
150241 end
旧リポジトリブラウザで表示