ユーザ提供のサンプルを追加していきます。(お好きなように追加してOKです。)
wms フォルダ内にテキストファイル(たとえばsample.txt)を作成し、このページのサンプルをコピーアンドペーストしてご利用ください。
シナリオのテキストからは、下記のように呼び出しできます。
@wms sample.txt
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(); }
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(); }
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(); }
メモ: 縦書きの句読点やカッコの文字が含まれるフォントをご利用ください。
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(); }
ローカル変数を初期化するなら次のようにします。
func main() { for(i in 0..9999) { s_set_variable(i, 0); } }