0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GOKI2で始めるADV開発【ModSaveLoad/ModSystemButtons入門】セーブ・ロード画面のレイアウトとシステムボタンの配置GOKI2で始めるADV開発【ModADV入門】セーブ・ロード画面のレイアウトとシステムボタンの配置

0
Last updated at Posted at 2025-12-20

セーブ/ロード

GOKI2では、ModSaveLoadモジュールがセーブロード画面を実装しています。
まずはモジュールを読み込みます。

/src/goki2/system/construct.gs
; セーブロード画面
@load_module name=ModSaveLoad

これでセーブロード画面が使えるようになりました。

セーブロード画面レイアウト

セーブロード画面のUIを配置していきますが、
その前に、まずUIを配置する領域を定義します。

@save_load_option client_left=10 client_top=10 client_width=780 client_height=580

これで、(10, 10)から(780, 580)までをUI配置領域とします。

次に、レコードのサイズを設定します。
一つのレコードは、一つのセーブデータに対応します。

@save_load record_width=780 record_height=140

これで、レコードが定義されました。
続けてレコード内にUIを配置していきます。

@save_load index_left=10 index_top=60
@save_load date_left=180 date_top=10
@save_load summary_left=180 summary_top=30

上から順に、インデックス、日付、サマリーの位置を指定しています。
サマリーは最後に表示したテキスト(正確にはメッセージレイヤに出力した内容)が表示されます。
ここで何も設定しなければレコードには何も表示されません。

最後にサムネイルを定義します。(必要なければ指定しなくてよいです)
位置とサイズ、ブランク時の背景色を指定できます。

@save_load thumbnail_left=30 thumbnail_top=0 thumbnail_width=150 thumbnail_height=120 thumbnail_color=0xFF0000

これで、セーブロード画面が完成しました。

システムボタン

ADVなどでお馴染みのシステムボタンは、ModSystemButtonsで実装されています。
まずはモジュールを読み込みます。

/src/goki2/system/construct.gs
; システムボタン
@load_module name=ModSystemButtons

これでシステムボタンが使えるようになりました。

システムボタンの配置

システムボタンを画面上に配置していきます。

; システムボタン
@system_button log_left=10 log_top=390 log_width=60 log_height=20 log_caption=履歴
@system_button skip_left=80 skip_top=390 skip_width=60 skip_height=20 skip_caption=スキップ
@system_button auto_left=150 auto_top=390 auto_width=60 auto_height=20 auto_caption=オート
@system_button hidden_left=220 hidden_top=390 hidden_width=60 hidden_height=20 hidden_caption=消去
@system_button system_left=290 system_top=390 system_width=60 system_height=20 system_caption=システム
@system_button save_left=360 save_top=390 save_width=60 save_height=20 save_caption=セーブ
@system_button load_left=430 load_top=390 load_width=60 load_height=20 load_caption=ロード
@system_button qsave_left=500 qsave_top=390 qsave_width=60 qsave_height=20 qsave_caption=Qセーブ
@system_button qload_left=570 qload_top=390 qload_width=60 qload_height=20 qload_caption=Qロード

ひとまず「履歴」ボタンの定義を見てみましょう。

まず、log_left=10 log_top=390でボタンの位置を指定します。
次に、log_width=60 log_height=20でボタンのサイズを指定します。
サイズ指定はボタンに画像を使うなら必要ありません。
最後に、log_caption=履歴でキャプションを指定します。
これで履歴ボタンが定義されました。

他のボタンも同じようにそれぞれの位置とサイズ、キャプションを指定しています。
使えるボタンはマニュアル(/doc/goki2/index.html)を参照してください。

システムボタンの表示

最後に、以下タグで定義したシステムボタンを表示させます。

@system_button_option visible

非表示にする場合は以下タグを実行します。

@system_button_option !visible

関連する記事の一覧

GOKI2の関連する記事一覧

ダウンロード

気になった方は以下サイトのリリースタグ(Avalanches(GOKI2) release version 2.x.y.yという表記)からAssetsにあるAvalanches-GOKI2-Release2.x.y.y.zipのリンクから最新の環境をダウンロードできます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?