- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2023-10-22T14:03:11+09:00","default:discord","discord")
#author("2023-12-17T11:31:18+09:00","default:discord","discord")
* WMSのサンプル [#a2b16f0c]
ユーザ提供のサンプルを追加していきます。(お好きなように追加してOKです。)
wms フォルダ内にテキストファイル(たとえばsample.txt)を作成し、このページのサンプルをコピーアンドペーストしてご利用ください。
シナリオのテキストからは、下記のように呼び出しできます。
@wms sample.txt
** メッセージ表示に関する初期化を行う [#ida4fb78]
func main() {
# 横書きを指定する
s2_set_config("msgbox.tategaki", "0");
# フォント名を指定する
s2_set_config("font.file", "VL-PGothic-Regular.ttf");
# メッセージボックスの画像を指定する
s2_set_config("msgbox.bg.file", "msgbox-bg.png");
s2_set_config("msgbox.fg.file", "msgbox-fg.png");
# メッセージボックスの座標を設定する
s2_set_config("msgbox.x", "0");
s2_set_config("msgbox.y", "457");
#メッセージボックス内のテキストのマージンを設定する
s2_set_config("msgbox.margin.left", "80");
s2_set_config("msgbox.margin.right", "80");
s2_set_config("msgbox.margin.top", "59");
#システムメニューを表示する
s2_set_config("sysmenu.hidden", "0");
#名前ボックスを表示する
s2_set_config("namebox.hidden", "0");
#クリックアニメーションをテキストの末尾でなく固定位置に表示する
s2_set_config("click.move", "0");
#クリックアニメーションの座標を設定する
s2_set_config("click.x", "1170");
s2_set_config("click.y", "645");
#メッセージと名前ボックスの画像を再読み込みする
s2_reflect_msgbox_and_namebox_config();
}
** ゲームの途中でメッセージ表示のデザインを変更する [#cf1098fd]
func main() {
s2_set_config("msgbox.bg.file", "msgbox-bg-b.png");
s2_set_config("msgbox.fg.file", "msgbox-fg-b.png");
s2_set_config("namebox.file", "namebox-b.png");
s2_reflect_msgbox_and_namebox_config();
}
** ゲームの途中でメッセージ表示を全画面の横書きに変更する [#gd04b775]
func main() {
s2_set_config("msgbox.tategaki", "0");
s2_set_config("font.file", "VL-PGothic-Regular.ttf");
s2_set_config("msgbox.bg.file", "full-screen-msgbox-bg.png");
s2_set_config("msgbox.fg.file", "full-screen-msgbox-bg.png");
s2_set_config("msgbox.x", "0");
s2_set_config("msgbox.y", "0");
s2_set_config("msgbox.margin.left", "80");
s2_set_config("msgbox.margin.right", "80");
s2_set_config("msgbox.margin.top", "50");
s2_set_config("namebox.hidden", "1");
s2_set_config("click.move", "1");
s2_reflect_msgbox_and_namebox_config();
}
** ゲームの途中でメッセージ表示を全画面(縦書き)に変更する [#h6916732]
メモ: 縦書きの句読点やカッコの文字が含まれるフォントをご利用ください。
func main() {
s2_set_config("msgbox.tategaki", "1");
s2_set_config("font.file", "GenEiMonoGothic-Regular.ttf");
s2_set_config("msgbox.bg.file", "full-screen-msgbox-bg.png");
s2_set_config("msgbox.fg.file", "full-screen-msgbox-bg.png");
s2_set_config("msgbox.x", "0");
s2_set_config("msgbox.y", "0");
s2_set_config("msgbox.margin.left", "80");
s2_set_config("msgbox.margin.right", "80");
s2_set_config("msgbox.margin.top", "50");
s2_set_config("msgbox.margin.bottom", "50");
s2_set_config("namebox.hidden", "1");
s2_set_config("click.move", "1");
s2_reflect_msgbox_and_namebox_config();
s2_reflect_font_config();
}
** すべての変数を初期化する [#y646199d]
ローカル変数を初期化するなら次のようにします。
func main() {
for(i in 0..9999) {
s_set_variable(i, 0);
}
}