第9章 システムスクリプト API リファレンス

図9-1: システムスクリプト API のイメージ
キャプチャ差し替え images/09_system_api.png

図9-1: システムスクリプト API のイメージ

図9-1: システムスクリプト API のイメージ — 差し替え: images/09_system_api.png

システムスクリプトは、先頭に // @lumina を書いた LUMINA Script(関数・変数・式が使える書き方)で記述します。目印が無く、function も無いファイルは SimpleScript(1 行に 1 命令を並べる書き方)として実行されます。

オブジェクトメソッド呼び出し Object.method(args) が基本です。本章はAPI リファレンスです。タイトル接続など作成手順は 制作者入門 08 を参照してください。

読み方: 前半はオブジェクト別の概要、後半は完全一覧です。ページ内のカテゴリジャンプ・上部の検索・モバイルでは左上の目次を使うと探しやすいです。

9.1 記法ルール


// @lumina

function setup() {
    System.debugLog("初期化開始");
    Window.setTitle("My Game");
    if (QuickSave.exists()) {
        System.debugLog("クイックセーブあり");
    }
    System.wait(500);
}
setup();

値を返すメソッド(凡例)

LUMINA Script では、var n = Backlog.getCount(); のように戻り値を使えるメソッドは一部だけです。リファレンスの表では、メソッド名の後ろに次の印を付けています。

印意味
(値)LUMINA Script で値を返す。SimpleScript でも命令として呼べる(値は受け取れない)
(値のみ)LUMINA Script の式の中でだけ使える。SimpleScript で呼ぶと「知らない命令」になる
印なし命令として動く。取得系(get… / is… など)でも値は返らない(下の注意)

Math・JSON・文字列・配列・正規表現のメソッドと組み込み関数は、どれも値を返します(表には印を付けていません)。

印の無い取得系は値を返しません。LUMINA Script では呼んだオブジェクト自身が返るため、印の無い get… / is… を if の条件に書くといつも真になり、var x = … にも結果は入りません。SimpleScript でも、成功した命令の結果は捨てられるので値は受け取れません。値が要るときは、印の付いた同じ働きのメソッドを使うか、結果を変数に書き込む命令(Confirm.show → 変数 confirm.result、Timer.storeElapsed、System.randomInt、Anime.createInstance / Motion.createInstance の varName、Select.wasTimedOut / Input.isGamepadConnected の varName、Steam の取得系の最後の引数)を使い、LUMINA Script なら System.getVarInt、SimpleScript なら System.ifVarEquals などで読んでください。

9.2 System オブジェクト

実行モード・デバッグ

メソッド引数説明
setRunMode"Debug" / "Release"実行モード設定
getRunMode(値)—現在モード取得
isDebugMode—Debug かどうか
debugLogmessageDebug 時ログ出力
debugDump—システム状態ダンプ
setDebugLogEnabledboolログ有効/無効

待機・実行

メソッド引数説明
waitmsミリ秒待機(メッセージポンプ)
execcodeインラインコード実行
timelinedefinition時系列ステップ実行
executecommand外部プログラム起動

分岐

メソッド説明
switchEnv(var, default, code0, code1, ...)環境変数で分岐
switchArg(index, default, code0, ...)コマンドライン引数で分岐
switchVar(name, code0, code1, ...)整数変数で分岐
ifVarEquals(name, val, codeIf[, codeElse])変数一致分岐
switch(mode, code0, code1, ...)数値直接分岐
switchIni(section, key, default, ...)INI 値で分岐

セーブ/ロード

メソッド説明
saveData(slot)使えません(呼ぶと失敗する)。SaveSlot.saveState(slot) を使う
loadData(slot)使えません。SaveSlot.loadState(slot) を使う
hasSaveData(slot)使えません。SaveSlot.hasState(slot) を使う

変数

メソッド説明
setVarInt(name, value)整数変数
setVarStr(name, value)文字列変数
getVarInt(name)(値) / getVarStr(name)(値)変数を読む
addVarInt / subVarInt / mulVarInt / divVarInt / modVarInt整数変数の計算

System の変数は、シナリオの setvar の変数(セーブデータごとの値)とは別のものです。

フラグ(どのセーブデータでも共通の記録)

メソッド説明
setSystemFlag(name, value) / addSystemFlag(name, value)システムフラグ(値は 0〜9 に丸める。0 を入れると下ろせる)
getSystemFlag(name)(値のみ) / checkSystemFlag(name, op, value)(値のみ)読む(未設定は 0)/比べる(1/0)
setClearFlag(name, value) / getClearFlag(name)(値のみ) / clearAllClearFlags()クリアフラグ(0 以外で立つ)
setFlowchartFlag(name, value) / addFlowchartFlag / getFlowchartFlag(値のみ) / checkFlowchartFlag(値のみ)フローチャートの印(0〜9 に丸める。0 を入れると下ろせる)

どれも systemdata に保存され、シナリオの setsysflag / setclearflag / setflowflag と同じ入れ物を読み書きします。好感度など周回で変わる値はシナリオの setvar を使います。

INI 制御

メソッド説明
setIniEnabled(bool)INI 読み書き有効化
setIniAutoCreate(bool)INI 自動生成
setIniBool(section, key, value)INI 値書き込み
ifIniEnabled(codeIf[, codeElse])INI 有効時分岐
ifIniBool(section, key, default, codeIf[, codeElse])INI bool 分岐

プラグイン

メソッド説明
clearPluginDirectories()検索パスクリア
addPluginDirectory(path)検索パス追加
setAllowedPlugins([...])ホワイトリスト
loadPlugin(dllName)DLL ロード

パス・フォルダ

メソッド説明
setDataRoot(path)データルート
getDataRoot()データルート取得
setFolder(key, path)フォルダマッピング
getFolder(key)フォルダパス取得
setExtension(type, ext)拡張子設定(systemScript 等)
getExtension(type)拡張子取得

セーブ設定

メソッド説明
setSaveRoot(kind)セーブ先("InstallPath" / "MyDocuments" / "MyGamesDocuments" / "AppData")
setSaveDataMode(mode)平文/c/z
setSaveDataId(id)製品識別子
setSaveProduct(brand[, game])製品名(ブランド名・作品名)
setSaveFolder(name)セーブフォルダの名前

UI・ダイアログ

メソッド説明
setStartupDialog(enabled)起動ダイアログ
setExitDialog(enabled)終了確認ダイアログを出すか
setScriptPassword(pw).lsf 復号パスワード
setSplashDelay(ms)スプラッシュ遅延
setSplashFade(fadeInMs, fadeOutMs)スプラッシュフェード
setSplashHold(ms)スプラッシュ保持
setVersion(text)バージョン表示
loadScenario(path)シナリオを新しく始める。始める前にシナリオ変数(setvar の値)を消す
jumpScenario(path[, label])別のシナリオへ切り替える。シナリオ変数は保つ(シナリオ実行中でも安全)
returnToTitle([kind, fadeOutMs])確認のうえタイトル復帰(kind 既定 titleExit)
exit([kind, fadeOutMs, holdMs])確認のうえゲーム終了(kind 既定 menuExit。fadeOutMs で暗転、holdMs は暗転しきってから閉じるまで)

表示

メソッド説明
showText(text[, x, y])テキスト表示
showImage(path[, x, y])画像表示
hideImage([fadeOutMs])画像非表示
fadeToBlack(ms) / fadeFromBlack(ms)黒い幕を張る/明ける(明けるのは幕が出ているときだけ)

フォント(System.font.*)

メソッド説明
font.setFamily(name)フォントファミリ
font.setBold(bool)太字
font.setDropShadow(bool)ドロップシャドウ
font.setOutline(bool)アウトライン
font.apply()適用
font.save() / font.load()永続化
font.getFamily()(値) / font.getFamilyCount()(値) / font.getFamilyAt(i)(値)今の書体・選べる書体の一覧
font.prewarm([count])組み込み書体を先に読んでおく(手が空いたときに 1 本ずつ)

メッセージウィンドウ(System.messageWindow.*)

メソッド説明
messageWindow.setAssets(frame, background, textArea)UI アセット設定
messageWindow.fadeOpacity(target, ms[, steps])透明度フェード
messageWindow.setPosition(x, y)位置設定
messageWindow.setTextSpeed(ms) / getTextSpeed()文字送りの速さ
messageWindow.setWordWrap(1) / getWordWrap()(値のみ)単語の途中で折り返さない(英語など)
messageWindow.setAdvanceIcon(path[, frames, frameW, frameH, intervalMs])文字送りアイコン

全部の命令は完全リファレンスの System にあります。

9.3 Window オブジェクト

メソッド説明
setTitle(title)ウィンドウタイトル
setSize(w, h)サイズ
setResizable(bool)リサイズ可否
setTopMost(bool)最前面
setIcon(path)アイコン
setAppId(id)タスクバー AppUserModelID
setFPS(n)フレームレート
setMultiCore(enabled, coreCount)マルチコアの使い方(2 引数が要る)
setScalingFilter(type[, cubicStrength])拡大時のスムージング(0=Lanczos / 1=Cubic / 2=SharpLinear / 3=Linear)
setScaleMode(mode)拡大方法(0=内接 / 1=外接 / 2=拡大しない / 3=中間)
setContentAspect(mode)4:3 画面モード(0=ワイド / 1=4:3 / 2=自動)
setMarginWallpaper(path)余白の帯に敷く絵(空で黒)
setAspectLock(mode)アスペクトロック
setSingleInstance(bool)多重起動防止
setSingleInstanceKey(key)多重起動キー
setCursor(name)カーソル(arrow/wait/ファイル)
resetCursor()カーソルリセット
setVirtualFullscreen(bool)仮想フルスクリーン
toggleVirtualFullscreen()フルスクリーン切替
applyScreenMode(mode)画面モード適用("FALSE"=ウィンドウ / "DirectX12" / "Win32")
applyFPS()FPS 適用
clear()画面の表示レイヤー(背景・立ち絵・イベント CG・スプライト・表示中の画像)を全部消す
getFPS() / getScaleMode() / getContentAspect() / getScalingFilter()(どれも値のみ)今の設定値を読む

9.4 Title オブジェクト

メソッド説明
clear() / clearButtons()クリア
setBackground(path)背景画像
setOverlay(path)オーバーレイ
addButton(actionId, x, y, normal, hover, pressed, disabled[, w, h])ボタン追加(7 引数は絵の実寸、9 引数は大きさを指定)
setButtonEnabled(actionId, enabled)ボタン有効化
register(actionId, code)ボタンのハンドラを登録
addLabel(id, x, y, w, h, text[, fontSize, color, bold, align])文字ラベル
show() / hide()表示/非表示
setFade(fadeInMs, fadeOutMs)フェード
setLayout(x, y, w, h)レイアウト
setSounds(hoverSE, clickSE, cancelSE)ボタン SE
waitUntilHidden([timeoutMs])非表示まで待機
skipWait()待機スキップ
isVisible()(値) / getHoveredButton()(値のみ)出ているか/乗っているボタン

ドラッグ&ドロップ・ラベル・ホイール・決定音声などを含む全部の命令は完全リファレンスの Title にあります。

9.5 Scenario オブジェクト

メソッド説明
load(path)シナリオを読み込んで始める(シナリオ変数は消さない)
play(path)load と同じ

9.6 Scripts オブジェクト

メソッド説明
execStorage(path)ストレージ上のスクリプト実行
preload(path)実行せずに読み込み・復号・解析だけ先に済ませる

拡張子省略時: 設定したシステムスクリプトの拡張子(.txt か .lsf)で探し、両方あれば更新日時の新しい方、片方しか無ければある方を使います。

9.7 Storages オブジェクト

メソッド説明
addAutoPath(path)リソース自動検索パス追加
clearAutoPath()検索パスクリア
setOverlay(dir)上書きフォルダ(言語別の差し替え先)。空で切る。9.7.2
getOverlay()いまの上書きフォルダ(切っていれば空)
isExistentStorage(path)そのファイルがあるか(1 / 0)。絵やスクリプトと同じ道筋(上書きフォルダ → 検索パス → データの根 → パックの中)で探す。system/RunMode.txt が開発中の印 data0/system/DevMode.txt の有無で実行モードを決めるのに使う

9.7.1 Text オブジェクト(多言語)

文言を言語ごとに差し替えます。設定の実体は system/Localization.txt にあり、 言語を足すときはそこの LANG_TABLE と data0/lang/<ID>.txt を直します。

メソッド説明
get(key, defaultText)(値のみ)文言を引く。第 2 引数(元の文言)は必ず書く
has(key)(値のみ)その鍵があるか
setLanguage(id) / getLanguage()(値のみ)出す言語
setFallback(id) / getFallback()(値のみ)訳が無いときに代わりに見る言語(既定 ja)
load(id, path)(値)文言表をファイルから読む(LUMINA Script では読んだ件数を返す。例 Text.load("en", "lang/en"))
loadText(id, text)(値)文言表を文字列から読む(読んだ件数を返す)
set(id, key, value)1 件だけ差し替える
listLanguages()(値のみ) / count(id)(値のみ)読み込んだ言語の一覧 / 件数
clear()表を全部捨てる

第 2 引数を必ず書いてください。表に無い鍵はその文字をそのまま返すので、 訳が抜けていても画面が壊れません。既存の画面を 1 つずつ置き換えていけます。

Text.get("confirm.title", "タイトルに戻りますか?")

文言表(data0/lang/ja.txt)は 1 行 1 件の 鍵=文言 です。 # で始まる行と空行は読み飛ばし、値の中の \n は改行になります。

# 確認ダイアログ
confirm.yes=はい
confirm.load=ロードしますか?\n現在の進行状況は失われます。

絵・音・シナリオは表ではなく上書きフォルダで切り替えます(次節)。

書体も言語で変わるので、切り替えたら System.font.setFamily(...) を入れ直してください (Localization.txt の applyLanguage() が文言・上書きフォルダ・書体をまとめて切り替えます)。

9.7.2 言語別の差し替え(上書きフォルダ)

確認ダイアログ・メッセージ枠のボタン・名前の札・環境設定の項目名などは文字が絵に焼いてあるので、 文言表では訳せません。シナリオも同様です。これらは上書きフォルダで差し替えます。

原語(Localization.txt の LANG_SOURCE)以外を選ぶと data0/lang/<ID>/ が上書きフォルダになり、素材を探すとき最初にそこを 1 か所だけ見ます。 無ければいつもの場所を探します。原語のときは切っているので、探し方は今までとまったく同じです。

置き方: スクリプトやシナリオに書く名前から、先頭の dataN/ を外した形で置く。

種類書き方(実体)英語版の置き場所
絵meswnd/name_M(data1/meswnd/name_M.lgc)data0/lang/en/meswnd/name_M.lgc
声・効果音vo "vo02_0001"data0/lang/en/vo02_0001.opus
シナリオSystem.loadScenario("scenario/ch01")data0/lang/en/scenario/ch01.txt(.lsf でも可)

同梱の英語版: 見本の UI は英語版の絵を data0/lang/en/ に同じ名前で持っています (タイトル・確認ダイアログ・セーブ/ロード・吹き出しと名前の札・上部メニュー・環境設定のタブと項目名・ フローチャート・スタッフロールなど 339 枚)。元の絵を描き直したときは次の道具で作り直し、 LuminaImageCompressor.exe <フォルダ> --recursive --overwrite --type auto --tlg で .lgc にします。

道具(Tool/01_Development)作る絵
localize_ui_images.py <data1> <出力> --lang en元の絵から日本語を消し、同じ見た目で英語を描き直す(ボタン・吹き出し・名前の札・手描きの見出しなど)。訳と様式は中の ITEMS 表
gen_config_layers.py screen|text|sound|chara <out.png> --lang en環境設定の項目名の絵
gen_flowchart_art.py <出力> --lang enフローチャートのノード
gen_staffroll_art.py <data0/lang/en> --lang enスタッフロールの帯とロゴ(仮)

文字で描いている画面の訳: 環境設定のヘルプ・送りの値・ダイアログ設定の項目名、 立ち絵鑑賞、CG/シーン/サウンド/ムービーモード、ステータス画面、システム音声の名札、シーン送りの幕は Text.get を通して引いています。鍵の付け方は次の 3 通りです(訳は en.txt の同じ節)。

鍵使う所
cfghelp.<項目id>.name / .0 / .1 / .2環境設定のヘルプ(ConfigMenu.txt の CFG_HELP)。日本語の行より英語の行が少ないときは、余る鍵を空の値で書く(書かないと日本語が出る)
str:<日本語>表から出る文字(キャラ名・服装・表情・曲名・動画名・送りの値など)。スクリプトの日本語を直したら鍵も直す
画面ごとの名前(cfg.dlg.*.cap・veil.skip など)決まった文言

これらの鍵は日本語の表(ja.txt)には書きません。スクリプトに書いた元の文言が、そのまま日本語として出ます。

環境設定の言語欄: 下の帯の左に「言語 ◀ 日本語 ▶」を置いています(言語が 1 つしか無い作品では出ません)。 押すと lang.request に行き先を入れて Localization.txt を呼び、文言・上書きフォルダ・折り返し・ メニュー・確認ダイアログ・ステータス画面・シーン送りの幕までまとめて切り替えてから、画面を組み直します。 言語の名前は LANG_TABLE の表示名(その言語自身の表記)です。

確認ダイアログ: 題・本文は Confirm.txt が表(confirm.*)から引きますが、 既定はどれも絵(dialog/msg_*、ボタンは dialog/btn_yes_* / btn_no_*)で出すので、 英語は data0/lang/en/dialog/ の英語版の絵で出ます。 ボタンの下の「次回から確認しない」だけは文字で描くので、表の confirm.dont_ask がそのまま効きます (Confirm.setOptOutLabel)。

原語(日本語)の表の値は、スクリプトに書いた元の文言と 1 文字も違えないでください。 日本語のときは表の値が出るので、違えると日本語の画面まで変わります。 また、鍵は表示する文言ごとに 1 つにしてください(同じ動作の項目でも表記が違えば別の鍵)。 同じ鍵を 2 か所で使うと、表には値が 1 つしか持てないため、片方の表記が入れ替わります。

見本: data0/lang/en/scenario/showcase_scene.txt(scenario/showcase_scene の英訳)。 紹介デモ(scenario/feature_demo)の本文は訳していないので、英語にしても日本語のまま出ます。

折り返し: メッセージ枠は 1 文字ずつ折り返すので、英語だと単語の途中で切れます。 Localization.txt の LANG_WORD_WRAP(既定 ["en"])に載せた言語では System.messageWindow.setWordWrap(1) が入り、空白の後ろでだけ行を変えます(行頭の句読点も避けます)。 載っていない言語(日本語など)は今までどおりです。バックログも同じ折り返しになります(Android / ブラウザ)。

確かめ方: 環境変数 LUMINA_LANG_TEST に言語 ID を入れて起動します (Windows は set LUMINA_LANG_TEST=en、Android は launch.txt、ブラウザは ?LUMINA_LANG_TEST=en)。 選んだ言語は保存されるので、戻すときは ja で起動します。

選んだ言語の保存: 環境設定と同じ仕組み(config.language)に 「LANG_TABLE の何番目か」の数で残します(環境設定で保存されるのは数だけです)。 そのため LANG_TABLE の並びは入れ替えず、言語を足すときは末尾へ足してください。 メニューバーは環境設定の復元(Config.txt の終わり)より前の PreInitialize.txt で組まれるので、 その回だけは System.getSavedVarInt で保存値を直接読みます(その回は保存しません)。 起動後に言語を切り替えたときは、メニューバー・システムメニュー・確認ダイアログの文言・ステータス画面・ シーン送りの幕を組み直します(どれも「組んだ言語」を lang.*Lang に残し、違うときだけ組み直す)。

9.8 Menu / MenuBar オブジェクト

Menu は項目を並べるメニュー、MenuBar は画面の上端に出る画像ボタンの帯(上部メニュー)です。

ブラウザ版のメニュー: Menu で組んだメニュー(ファイル・画面・フォント・ヘルプ)は、ページの上の端へマウスを寄せると出る帯になります。「手前に置く」「終了」など、ブラウザでできない項目は出ません。確認・設定などの画面、文字入力、バックログを出している間は選べません(帯が薄くなります)。MenuBar(上部メニュー)を使う場面では、上の端へ寄せても帯は出ないので、Alt キー(Alt だけを押して離す)で出し入れします。どの場面でも Alt キーで出せます。指で触るだけの端末では、2 本指で軽く叩くと帯が出る・しまう(2 本指の叩きはゲームへ届きません)。

Android のメニュー: 電話の「戻る」で、同じメニューの一覧が出ます。サブメニューの中の「戻る」は 1 つ上へ戻り、外を触ると閉じます。確認・設定などの画面やバックログを出している間の「戻る」は、その画面の「戻る」(パッドの B と同じ)です。文字の入力中は今までどおり入力欄へ届きます。窓の大きさ・全画面の切り替え・手前に置く・描画の分割・セーブフォルダ・ログ・書体の窓など、Android でできない項目は出ません。

Android・ブラウザの「バージョン情報」「ライセンス」「システム情報」: メニューから選ぶと、画面の上に文章の画面で出ます。長い文章は指でなぞる・ホイール・↑↓・PageUp・PageDown・Home・End・パッドで送り、OK・Esc・右クリック・パッドの B・Android の「戻る」で閉じます。

Menu

メソッド説明
clear()メニュークリア
register(id, action)ハンドラを登録
addMenu(path) / addMenu(parent, title)サブメニュー追加("親/子" の 1 引数でも書ける)
addItem(parent, title[, action])項目追加
addSeparator(parent)区切り線
begin(title) / end()構築ブロック
item(title, action) / separator()項目・区切り線(ブロック内)
setup(definition) / apply()構築・適用
setVisible(visible[, force])表示切替
handle(id)登録したハンドラを実行

MenuBar

メソッド説明
addButton(actionId, x, y, normal, rollover, active, inactive)ボタン追加
register(actionId, handlerCode)ボタンのハンドラを登録
setBackground(path) / setLogo(path[, x, y])背景・ロゴ
setActive(mode)出す場面(0=出さない / 1=シナリオ中 / 2=システム画面 / 3=両方)
setDisplayMode(mode)"slide"(スライド式。既定)/ "inplace"(その場で透明度を変える)
show() / hide() / apply()表示・反映

9.9 Input オブジェクト

ADV 入力のポーリング API。isAdvanceTextRequested() などの判定と、マウス・タッチ・コントローラーの値は、LUMINA Script では値を返します(判定は 1/0)。

メソッド説明
isAdvanceTextRequested()(値)文字送り
isSkipRequested()(値) / isSkipHeld()(値)スキップ
isAutoModeRequested()(値)オートモード
isBacklogRequested()(値)バックログ
isSystemMenuRequested()(値)システムメニュー
isQuickSaveRequested()(値)クイックセーブ
isQuickLoadRequested()(値)クイックロード
isCancelRequested()(値)キャンセル
isUpRequested()(値) / isDownRequested()(値) / isLeftRequested()(値) / isRightRequested()(値)方向
update()入力更新
getLeftStickX([playerIndex])(値) 等コントローラーの値
setVibration(playerIndex, left, right)振動
isLeftClicked()(値) 等マウス
getMouseX()(値) / getMouseY()(値)マウスの座標(設計座標 1280×720)
isMouseDown()(値) / isRightMouseDown()(値) / isMouseClicked()(値)ボタンを押しているか/クリックされたか(1/0)
hitTest(x, y, w, h)(値)マウスがその矩形の中か(1/0)
setGestureAction(dir, actionId) / setGestureImage(dir, path) / setGestureDecoration(...)マウスジェスチャの割り当てと見た目
setGamepadEnabled(on) / isGamepadConnected()(値)ゲームパッドで操作するか/つながっているか(下記)

ゲームパッド

Windows・Android・ブラウザのどれでも、ゲームパッドで文章送り・選択肢・各画面を操作できます(既定で有効)。Windows はゲームの窓が前面にあるときだけ効きます。Android はキーボードの対応するキー(Enter・Esc・矢印・PageUp・Ctrl)も同じ扱いで受けます(電話の「戻る」はメニューの一覧を出します。確認・設定などの画面やバックログでは、その画面の「戻る」です)。ブラウザは Gamepad API で、最初に見つかったパッドを使います。

ボタン働き
A決定(文章送り・選択肢・画面のボタン)
B / START取り消し(右クリックと同じ。戻る・メッセージ枠を隠す)
十字キー / 左スティック上下左右(押し続けると繰り返す)
LBバックログ
RB(押し続け)スキップ

選択肢は十字キーで選んでから A で決めます(Android・ブラウザでは、まだ選んでいないときの A は最初の選択肢に印を付けるだけです)。Screen の画面での動きは Screen の説明を見てください。使わないときは Input.setGamepadEnabled(0)。Input.isGamepadConnected() は、Windows では今つながっているか、Android・ブラウザでは一度でもパッド(Android はキーボードの対応するキーも)を受けたかを返します。

9.10 Sound / Movie / Anime / Motion / Scene3D

Sound

オブジェクト主なメソッド
Sound汎用音声制御。playBgm / playSe / playVoice などの平らな名前と、Sound.bgm.play / Sound.se.play / Sound.voice.play / Sound.sysse.play / Sound.sysvoice.play の小分けの書き方がある
Sound.BGMBGM 再生・音量(play(path) / stop() / setVolume(volume) など)
Sound.SESE 再生(play(path) / stopAll() など)

Movie

メソッド説明
play(path[, x, y, mask, async])動画再生(終わるまで待つには Common.WaitMovieEnd)
stop() / pause() / resume()制御
setVolume(volume)音量
seek(ms)シーク
setViewport(x, y, w, h) / setFullscreen(1)枠の中で再生する/画面いっぱいへ戻す
isPlaying()(値) / getPositionMs()(値のみ) / getDurationMs()(値のみ)再生中か・再生位置・長さ

Anime / Motion(プラグイン必要)

オブジェクト説明
Animemruanime.dll 連携(部品を階層で動かすアニメーション。疑似3D の向き付けも可)
Motionmrumotion.dll 連携(メッシュ変形のアニメーション。繋ぎ・まばたき・口パク・当たり判定)
Scene3D3D 場面(glTF 2.0 / GLB)。背景レイヤーへ合成。別 DLL ではない

Anime / Motion は createInstance(modelName) が返す番号でインスタンスを指します(LUMINA Script では値として返る。SimpleScript では 2 番目の引数に変数名を書くとそこへ入る)。

Scene3D

3D 場面を背景レイヤーへ合成します。Scene3D.begin(w, h)、Scene3D.attach(layer)、loadModel(glTF 2.0 / GLB)、createBox 等、addLight、playModelAnimation。歩き回って遊ぶ 3D アクション(プレイヤー・アクター・武器・地形)と物理(剛体・拘束・ラグドール)の命令もあります(完全リファレンスの Scene3D)。別 DLL ではありません。3D が使えない環境では begin が失敗し、2D はそのまま動きます。

9.11 その他のオブジェクト

オブジェクト用途
Common古くからある命令(Wait, ShowImage, PlayMovie, bgm_play 等)。名前だけでも呼べる(Common)
QuickSave / Suspend / QuickResumeクイックセーブ・サスペンド
MessageWindowメッセージウィンドウ直接制御
Background / Bg背景制御
Chara / Character立ち絵
Sprite / SpriteSheetスプライト
EventCGイベント CG
Effect / Particleエフェクト
FX画像のいらない図形の演出(FX)
Transitionトランジション(ルール画像・場面まるごとの切り替えを含む)
Camera / BlendMode / TextureFilterカメラ・合成方法・補間
Backlogバックログ
Select選択肢 API
SaveSlotセーブスロット(本編セーブ・サムネイル・スロットの複製と入れ替え)
Galleryギャラリー
Confirm確認ダイアログ
Display表示設定
ConfigState設定状態
AutoSkip / VoiceCharacter / LipSyncオート・スキップ/話者ごとの音量/口パク
Debug / consoleデバッグユーティリティ(console は Debug の別名)
Timerタイマー
Easingイージング関数
Draw / RenderTarget / Scissor描画制御
Cursorカーソルを動かす(Cursor)
Screen名前付きの汎用画面(フローチャート・マップ・ステータスなどの土台。Screen)
TextInput文字入力(TextInput)
SteamSteam の実績・統計・オーバーレイなど(Steam)
InputUtility / SystemMenu / SystemInfo入力の補助・システムメニュー・システム情報
Scene3D3D 場面(glTF / GLB、基本形状、ライト、スキニング、3D アクション、物理)

9.12 組み込み関数・グローバル

Common(古くからある命令)


Common.Wait(1000);
Wait(1000);                          // オブジェクト名を省いても同じ
Common.ShowImage("logo.png", 0, 0);
Common.PlayMovie("intro.ogv", 0, 0);
Common.LoadScenario("scenario/main");
bgm_play("title", 2000);             // 2 秒で BGM を上げる

Math / JSON / Array / 文字列


Math.floor(3.7);          // 3
Math.random();            // 0.0〜1.0 未満
Math.random(1, 6);        // 1〜6 の整数
Math.PI;                  // 3.14159…
var a = [3, 1, 2];
a.push(4);                // a は [3, 1, 2, 4]
Array.isArray(a);         // true
"a,b,c".split(",");       // ["a", "b", "c"]
"ch01_02".match(/\d+/g);  // ["01", "02"]
parseInt("42");           // 42
JSON.stringify(obj);
JSON.parse(str);

以前ここに載せていた JSON.isArray はありません。配列かどうかは Array.isArray で調べます。

フラグ API


// @lumina
// システムフラグ(どのセーブデータでも共通。値は 0〜9。0 で下ろす)
System.setSystemFlag("route_a", 1);
System.addSystemFlag("route_a", 1);
var r = System.getSystemFlag("route_a");        // 未設定なら 0
if (System.checkSystemFlag("route_a", ">=", 2)) {
    System.debugLog("route_a は 2 以上");
}

// クリアフラグ
System.setClearFlag("game_cleared", 1);
if (System.getClearFlag("game_cleared") == 1) {
    System.debugLog("クリア済み");
}

// フローチャートの印
System.setFlowchartFlag("ch02", 1);

// System の変数(数えるだけの値など)
System.setVarInt("play_count", 0);
System.addVarInt("play_count", 1);

読み出し(getSystemFlag / checkSystemFlag / getClearFlag / getFlowchartFlag / checkFlowchartFlag)は LUMINA Script の式の中でだけ使えます。好感度などセーブデータごとの値はシナリオの setvar / addvar を使います(システムスクリプトからは読み書きできません)。以前この節に載せていた SetScenarioFlag / SetSystemFlag / SetFlag / SetCounter などの関数は使えません(使えない旧グローバル関数)。

9.13 制御構文(LUMINA Script)

LUMINA Script では if / else、for(for ... of も可)、while、do ... while、switch、break / continue、function / return、var / let / const、try / catch / finally / throw、class / new、アロー関数((a, b) => a + b)、三項演算子、??、?.、typeof が使えます。


if (score >= 100) {
    System.debugLog("クリア");
} else {
    System.debugLog("継続");
}

for (var i = 0; i < 10; i += 1) {
    System.debugLog(i);
}

goto / gosub などのラベル移動はシナリオの命令です(第10章)。システムスクリプトでは使えません。


頻出 API の抜粋のあと、全メソッドの詳細リファレンスを掲載します。


システムスクリプト API 完全リファレンス

オブジェクト数: 62 メソッド総数: 1196(表の行数。組み込み関数 7 個と、使えない旧グローバル関数 29 個は含まない)

各メソッドに引数・説明・呼び出し例を付けています。引数の [ ] の中は省略できます(省いたときの値は説明に書いた既定値)。引数が — のものは引数を取りません。メソッド名の後ろの (値)・(値のみ) の意味は 9.1 の凡例を見てください。

Anime (29)

mruanime プラグインが必要です(System.loadPlugin)。handle は createInstance が返すインスタンス番号です。

メソッド引数説明呼び出し例
clearExpressionhandle表情を外すAnime.clearExpression(handle)
createInstance(値)modelName[, varName]インスタンスを作り番号を返す。SimpleScript では varName の変数へ入るAnime.createInstance(modelName[, varName])
destroyAll—インスタンスを全部消すAnime.destroyAll()
destroyInstancehandleインスタンスを消すAnime.destroyInstance(handle)
getInstanceCount(値のみ)—インスタンスの数Anime.getInstanceCount()
hasInstances(値のみ)—インスタンスがあるか(1/0)Anime.hasInstances()
isFinished(値)handleモーションが終わったか(1/0)Anime.isFinished(handle)
isPlaying(値)handleモーション再生中か(1/0)Anime.isPlaying(handle)
loadExpressionmodelName, exprPath表情を読み込むAnime.loadExpression(modelName, exprPath)
loadModel(値)name, jsonPathモデルを読み込む。LUMINA Script では読めたら 1、読めなければ 0Anime.loadModel(name, jsonPath)
loadMotionmodelName, motionPathモーションを読み込むAnime.loadMotion(modelName, motionPath)
playMotionhandle, motionName[, speed]モーションを再生(speed 既定 1.0)Anime.playMotion(handle, motionName[, speed])
playOverlayhandle, motionName[, speed, weight]重ねがけのモーションを再生Anime.playOverlay(handle, motionName[, speed, weight])
resetPhysicshandle揺れ物の物理を初期状態へ戻すAnime.resetPhysics(handle)
set3DAngleshandle[, yaw, pitch, roll]疑似3D の向き(度。左右・うなずき・傾げ)Anime.set3DAngles(handle[, yaw, pitch, roll])
set3DSetuphandle[, enabled, pivotX, pivotY, focal, curveX, curveY]疑似3D の土台(使うか・回転の中心・遠近の強さ(既定 1500。小さいほど強い)・横/縦の丸み)Anime.set3DSetup(handle[, enabled, pivotX, pivotY, focal, curveX, curveY])
set3DStrengthhandle[, depthScale, perspective]疑似3D の効き(奥行き・遠近。既定 1, 1)Anime.set3DStrength(handle[, depthScale, perspective])
setAlphahandle, alpha不透明度Anime.setAlpha(handle, alpha)
setDrawOrderhandle, order描画順Anime.setDrawOrder(handle, order)
setExpressionhandle, name表情を切り替えるAnime.setExpression(handle, name)
setPositionhandle, x, y位置Anime.setPosition(handle, x, y)
setScalehandle, sx, sy拡大率Anime.setScale(handle, sx, sy)
setVisiblehandle, visible表示切替Anime.setVisible(handle, visible)
setWindhandle, wx, wy風(揺れ物)Anime.setWind(handle, wx, wy)
stopAllOverlayshandle重ねがけを全部止めるAnime.stopAllOverlays(handle)
stopMotionhandleモーションを止めるAnime.stopMotion(handle)
stopOverlayhandle, name重ねがけを 1 つ止めるAnime.stopOverlay(handle, name)
unloadAll—モデルを全部破棄するAnime.unloadAll()
unloadModelnameモデルを破棄するAnime.unloadModel(name)

Array (19)

配列の値に対して arr.push(x) のように呼ぶメソッドです。静的に呼ぶのは Array.isArray だけです。どれも値を返します。

メソッド引数説明呼び出し例
concatvalue...配列や値をつないだ新しい配列arr.concat(value...)
filterfn条件に合う要素だけの新しい配列(fn は関数か関数名の文字列。fn(要素, 番号))arr.filter(fn)
findfn条件に合う最初の要素(無ければ undefined)arr.find(fn)
forEachfn要素ごとに fn を呼ぶarr.forEach(fn)
includesvalue含むか(true/false)arr.includes(value)
indexOfvalue位置(無ければ -1)arr.indexOf(value)
isArrayvalue配列か(true/false)。Array.isArray(x) と書くArray.isArray(x)
join[sep]文字列に連結(sep 既定 ",")arr.join([sep])
lastIndexOfvalue後ろから探した位置arr.lastIndexOf(value)
mapfnfn の結果を並べた新しい配列arr.map(fn)
pop—末尾を取り出すarr.pop()
pushvalue...末尾へ足し、新しい長さを返すarr.push(value...)
reverse—逆順にするarr.reverse()
shift—先頭を取り出すarr.shift()
slice[start, end]部分配列(負は後ろから)arr.slice([start, end])
sort[fn]並べ替え(fn(a, b) が負なら a が先)arr.sort([fn])
splicestart[, count, item...]取り除き・差し込み。取り除いた要素の配列を返すarr.splice(start[, count, item...])
toString—カンマ区切りの文字列arr.toString()
unshiftvalue...先頭へ足し、新しい長さを返すarr.unshift(value...)

push / pop / shift / unshift / splice / reverse / sort が配列そのものを書き換えるのは、変数に対して直接呼んだとき(arr.push(x))だけです。要素数は arr.length で読めます。

AutoSkip (14)

メソッド引数説明呼び出し例
getAutoDelay(値)—オートの待ち時間(ms)AutoSkip.getAutoDelay()
getAutoMaxSpeed(値)—倍速オートの最大段AutoSkip.getAutoMaxSpeed()
getAutoMode(値)—オート中か(1/0)AutoSkip.getAutoMode()
getAutoSpeedLevel(値)—倍速オートの今の段AutoSkip.getAutoSpeedLevel()
getAutoTurboEnabled(値)—倍速オートが有効か(1/0)AutoSkip.getAutoTurboEnabled()
getSkipDelay(値のみ)—スキップの間隔(ms)AutoSkip.getSkipDelay()
getSkipMode(値)—スキップ中か(1/0)AutoSkip.getSkipMode()
setAutoDelay[ms]オートの待ち時間(既定 3000)AutoSkip.setAutoDelay([ms])
setAutoMaxSpeed[max]倍速オートの最大段(既定 4)AutoSkip.setAutoMaxSpeed([max])
setAutoMode[on]オートの入切(引数なしで入)AutoSkip.setAutoMode([on])
setAutoTurboEnabled[on]倍速オートモード(既定 切)AutoSkip.setAutoTurboEnabled([on])
setAutoWaitVoice[on]オートでボイスの終わりを待つか(既定 入)AutoSkip.setAutoWaitVoice([on])
setSkipDelay[ms]スキップの間隔(既定 50)AutoSkip.setSkipDelay([ms])
setSkipMode[on]スキップの入切(引数なしで入)AutoSkip.setSkipMode([on])

Background (16)

Bg でも呼べます(同じもの)。set / show・clear / hide はシナリオ用の背景 1 枚を、*Layer 系は番号付きの背景レイヤー(0〜19)を扱います。frames は 1/60 秒単位です。

メソッド引数説明呼び出し例
clear—シナリオ背景を消す(hide と同じ)Background.clear()
fadeOutLayerid, framesレイヤーをフェードアウトBackground.fadeOutLayer(id, frames)
hide—シナリオ背景を消す(clear と同じ)Background.hide()
hideAll—背景レイヤーを全部消すBackground.hideAll()
hideLayeridレイヤーを消すBackground.hideLayer(id)
moveLayerid, dstX, dstY, framesレイヤーを移動Background.moveLayer(id, dstX, dstY, frames)
setpathシナリオ背景を出す(show と同じ)Background.set(path)
setFadeEasingfadeInMode, fadeOutModeレイヤーのフェードの効き(0=直線 / 1=減速 / 2=加速 / 3=両端ゆるやか)Background.setFadeEasing(fadeInMode, fadeOutMode)
setMoveEasingmode移動の効き(番号は setFadeEasing と同じ)Background.setMoveEasing(mode)
showpathシナリオ背景を出す(set と同じ)Background.show(path)
showLayerid, path[, x, y]レイヤーに絵を出すBackground.showLayer(id, path[, x, y])
showLayerFadeInid, path, x, y, framesフェードインで出すBackground.showLayerFadeIn(id, path, x, y, frames)
showLayerRuleid, path, x, y, rule, frames[, vague]ルール画像(rule フォルダの白黒の絵)の暗い所から順に出す。前の絵は下に残る。vague は境目のぼかし(0〜255、既定 64)。シナリオの bg のルール指定と同じBackground.showLayerRule(id, path, x, y, rule, frames[, vague])
startScrollid, path, x, y, speedX, speedYスクロールしながら出すBackground.startScroll(id, path, x, y, speedX, speedY)
stopScrollidスクロールを止めるBackground.stopScroll(id)
zoomLayerid, fromScale, toScale, framesゆっくり寄る/引くBackground.zoomLayer(id, fromScale, toScale, frames)

Backlog (33)

メソッド引数説明呼び出し例
clear—履歴を消すBacklog.clear()
getCount(値)—件数Backlog.getCount()
getLabel(値)indexその行のラベルBacklog.getLabel(index)
getNameMode(値)—名前の出し方(0=文字 / 1=画像)Backlog.getNameMode()
getScriptPath(値)indexその行のシナリオBacklog.getScriptPath(index)
getSpeaker(値)indexその行の話者名Backlog.getSpeaker(index)
getText(値)indexその行の本文Backlog.getText(index)
isJumpable(値)indexその行へ戻れるか(1/0)Backlog.isJumpable(index)
isSceneJumpEnabled(値)—シーンジャンプが有効か(1/0)Backlog.isSceneJumpEnabled()
pushspeaker, text手で 1 行足す(戻り先なし)Backlog.push(speaker, text)
resetTextures—描いた絵を作り直すBacklog.resetTextures()
setAssetDirectory[dir]素材のフォルダ(既定 backlog)Backlog.setAssetDirectory([dir])
setAssetNamekey, name素材のファイル名を差し替えるBacklog.setAssetName(key, name)
setBackButtonAreax, y, w, h戻るボタンの位置Backlog.setBackButtonArea(x, y, w, h)
setBackgroundOpacityvalue面(下敷き)の濃さ 0.0〜1.0。枠・行・文字はそのままBacklog.setBackgroundOpacity(value)
setFont[fontName]書体(既定 Meiryo)Backlog.setFont([fontName])
setFontSize[textSize, speakerSize, labelSize]文字の大きさ(既定 14 / 14 / 13)Backlog.setFontSize([textSize, speakerSize, labelSize])
setFrameLayoutx, y, w, h枠の位置と大きさBacklog.setFrameLayout(x, y, w, h)
setJumpButtonAreaoffX, offY, w, hジャンプボタンの位置(行の中)Backlog.setJumpButtonArea(offX, offY, w, h)
setLabelColorr, g, bラベルの色Backlog.setLabelColor(r, g, b)
setLabelLayoutx, y, w, hラベルの位置Backlog.setLabelLayout(x, y, w, h)
setMaxEntries[max]残す件数(既定 100)Backlog.setMaxEntries([max])
setNameAssetsPathpath名前画像のフォルダBacklog.setNameAssetsPath(path)
setNameModemode名前の出し方(0=文字 / 1=画像)Backlog.setNameMode(mode)
setPortraitAreaoffX, offY, w, h顔画像の位置(行の中)Backlog.setPortraitArea(offX, offY, w, h)
setRowAreax, y, w, h, sepH, visibleRows行の並びBacklog.setRowArea(x, y, w, h, sepH, visibleRows)
setSceneJumpEnabled[on]シーンジャンプの入切Backlog.setSceneJumpEnabled([on])
setScrollLayoutbtnX, btnW, btnH, upY, pageUpY, pageDownY, downY, trackX, trackY, trackW, trackH, thumbW, thumbHスクロール部品の配置Backlog.setScrollLayout(btnX, btnW, btnH, upY, pageUpY, pageDownY, downY, trackX, trackY, trackW, trackH, thumbW, thumbH)
setSpeakerAreaoffX, offY, w, h話者名の位置(行の中)Backlog.setSpeakerArea(offX, offY, w, h)
setSpeakerColorr, g, b話者名の色Backlog.setSpeakerColor(r, g, b)
setTextAreaoffX, offY, w, h本文の位置(行の中)Backlog.setTextArea(offX, offY, w, h)
setTextColorr, g, b本文の色Backlog.setTextColor(r, g, b)
setVoiceButtonAreaoffX, offY, w, hボイス再生ボタンの位置(行の中)Backlog.setVoiceButtonArea(offX, offY, w, h)

BlendMode (2)

メソッド引数説明呼び出し例
reset—合成方法を通常へ戻すBlendMode.reset()
setmode場面の合成方法(0=通常 / 1=加算 / 2=乗算 / 3=スクリーン。4=減算・5=上書きは Windows 版では通常扱い)BlendMode.set(mode)

Camera (2)

メソッド引数説明呼び出し例
reset—カメラを元に戻す(揺れも止める)Camera.reset()
setx, y[, zoom, rotation]場面のカメラ(ずらし・拡大(既定 1)・回転(ラジアン、既定 0))。次に描くときに効くCamera.set(x, y[, zoom, rotation])

Chara / Character (13)

Character でも呼べます(同じもの)。

メソッド引数説明呼び出し例
addFrameSynclayer, frames, charaSpecframes コマ後に差分へ切り替える予約Chara.addFrameSync(layer, frames, charaSpec)
addVoiceSynclayer, positionMs, charaSpecボイスの再生位置で差分へ切り替える予約Chara.addVoiceSync(layer, positionMs, charaSpec)
changelayer, charaSpec[, frames]差分を切り替えるChara.change(layer, charaSpec[, frames])
clear—立ち絵を全部消す(clearAll と同じ)Chara.clear()
clearAll—立ち絵を全部消すChara.clearAll()
clearVoiceSynclayer切り替えの予約を消すChara.clearVoiceSync(layer)
hidelayer[, frames]消すChara.hide(layer[, frames])
isAnimating(値)layer動きの途中か(1/0)Chara.isAnimating(layer)
setBodycharaId[, partName]素体を登録する(素体と表情の差分を重ねて 1 枚の立ち絵にする)Chara.setBody(charaId[, partName])
setFitPercentcharaId, percentフォルダ付き("ch01/smile" など)で出したときに当てる大きさの割合(%)Chara.setFitPercent(charaId, percent)
setTextureFilterlayer, filter拡大縮小の補間(-1=既定 / 0=Point / 1=Linear / 2=Anisotropic)Chara.setTextureFilter(layer, filter)
setVisiblePercentlayer, percent絵の上から何 % を画面の高さいっぱいに映すか(1〜100。100 で全身。残りは画面の下へはみ出す)Chara.setVisiblePercent(layer, percent)
showlayer, charaSpec, position, frames立ち絵を出すChara.show(layer, charaSpec, position, frames)

Common (21)

ロゴ・スプラッシュ向けの古くからある命令です。Common.Wait(500) のほか、オブジェクト名を付けずに Wait(500) とも書けます(LUMINA Script で知らない関数名を呼ぶと Common の命令として実行されます)。Wait / WaitLogoSkip / WaitMovieEnd / ShowImage / HideImage は小文字始まり(wait など)でも呼べます。

メソッド引数説明呼び出し例
bgm_playfile[, fadeInMs]BGM をループ再生(fadeInMs が 0 より大きいと無音から設定音量まで上げる)Common.bgm_play(file[, fadeInMs])
bgm_stop[fadeOutMs]BGM を止める(fadeOutMs が 0 より大きいとフェードし、止まるまで待つ)Common.bgm_stop([fadeOutMs])
HideImage[fadeOutMs]ShowImage の画像を消すCommon.HideImage([fadeOutMs])
Includepathスクリプトファイルを実行(Scripts.execStorage と同じ)Common.Include(path)
LoadScenariopathシナリオを読み込んで始める(シナリオ変数は消さない)Common.LoadScenario(path)
PauseMovie—動画を一時停止Common.PauseMovie()
PlayMoviepath[, x, y, mask, async]動画を再生(Movie.play と同じ)Common.PlayMovie(path[, x, y, mask, async])
se_playfile[, loop]SE を鳴らす(loop が 0 以外ならループ)Common.se_play(file[, loop])
se_stop[fadeOutMs]SE を全部止める(fadeOutMs が 0 より大きいと、すぐ無音にしてその時間待ってから止め、最後に SE の音量を 100 に戻す)Common.se_stop([fadeOutMs])
SeekMoviems動画の再生位置Common.SeekMovie(ms)
SetMovieRaterate動画の再生速度Common.SetMovieRate(rate)
SetMovieVolumevolume動画の音量Common.SetMovieVolume(volume)
setSplashFadefadeInMs, fadeOutMsスプラッシュのフェードCommon.setSplashFade(fadeInMs, fadeOutMs)
setSplashHoldholdMsスプラッシュを保つ時間Common.setSplashHold(holdMs)
SetVersiontextバージョン表示Common.SetVersion(text)
ShowImagepath[, x, y]画像を出すCommon.ShowImage(path[, x, y])
ShowTexttext[, x, y]文字を出すCommon.ShowText(text[, x, y])
StopMovie—動画を止めるCommon.StopMovie()
Waitms待つ(描画は止めない)Common.Wait(ms)
WaitLogoSkip[ms, skipMode]クリックで飛ばせる待ち(ms 既定 1500。skipMode 0=左 / 1=右 / 2=左右同時 / 3=どちらか(既定)。Esc でも飛ばす)Common.WaitLogoSkip([ms, skipMode])
WaitMovieEnd[timeoutMs, cancelMode]動画が終わるまで待つ(timeoutMs 0 = 無制限。cancelMode 0=飛ばせない / 1=左 / 2=右 / 3=どちらか(既定))Common.WaitMovieEnd([timeoutMs, cancelMode])

ConfigState (3)

メソッド引数説明呼び出し例
get(値)key環境設定の値を読む(sysAnim / skip / autoSave / mouseGesture / dlg.〈種別〉 など)ConfigState.get(key)
reset—環境設定を全部既定値に戻す(config.* の変数も更新)ConfigState.reset()
setkey, value環境設定の値を書く(System の変数 config.〈key〉 も同時に更新)ConfigState.set(key, value)

Confirm (20)

kind は確認ダイアログの種別名(system/Confirm.txt で設定するもの。menuExit・titleExit など)です。type は 0=出さない / 1=標準(OS の窓)/ 2=リソース / 3=画像。名前("none" / "windows" / "resource" / "image")でも書けます。

メソッド引数説明呼び出し例
askYesNo(値)message[, caption, yesLabel, noLabel]はい/いいえの窓を出す。LUMINA Script では、はいなら 1・いいえなら 0 を返す(SimpleScript では答えを受け取れない)Confirm.askYesNo(message[, caption, yesLabel, noLabel])
configurekind, type, caption[, prompt]種類・題・本文をまとめて設定Confirm.configure(kind, type, caption[, prompt])
dumpImageLayoutkind絵からボタン位置の案を計算してログへ出すConfirm.dumpImageLayout(kind)
exit[kind]終了確認を出し、はいなら終了する(kind 既定 menuExit。読むのは kind だけ)Confirm.exit([kind])
setAutoCursorenabled自動カーソル移動ON/OFFConfirm.setAutoCursor(enabled)
setAutoCursorTargettarget自動カーソルの移動先ボタン("yes" / "no" / "suspend")Confirm.setAutoCursorTarget(target)
setImagekind[, path]文言の絵(空で文字で描く)。Windows 以外で使う(Windows は画像ダイアログ側の設定を使う)Confirm.setImage(kind[, path])
setImageAnimationkind, type出し方の動きConfirm.setImageAnimation(kind, type)
setImageAssetskind, background, yesNormal, yesHover, yesPressed, yesDisabled, noNormal, noHover, noPressed, noDisabled背景とボタンの絵(10 引数)Confirm.setImageAssets(kind, background, yesNormal, yesHover, yesPressed, yesDisabled, noNormal, noHover, noPressed, noDisabled)
setImageDirectorydir絵のフォルダConfirm.setImageDirectory(dir)
setImageLayoutkind, yesX, yesY, noX, noYボタンの位置Confirm.setImageLayout(kind, yesX, yesY, noX, noY)
setImageMessagekind, messagePath本文の絵Confirm.setImageMessage(kind, messagePath)
setImagePanelkind, panelPath枠の絵Confirm.setImagePanel(kind, panelPath)
setImageSuspendAssetskind, normal, rollover, active, inactive3 つ目(中断)ボタンの絵Confirm.setImageSuspendAssets(kind, normal, rollover, active, inactive)
setLayoutbuttonGap, bottomMargin, dontAskHボタンの間隔・下の余白・「次回から確認しない」の高さ(全プラットフォーム共通)Confirm.setLayout(buttonGap, bottomMargin, dontAskH)
setOptOutKeykind[, key]「次回から確認しない」の保存先。同じ key を渡した種別は 1 つの設定になる。空ならその種別ではチェックを出さないConfirm.setOptOutKey(kind[, key])
setOptOutLabeltext「次回から確認しない」の文言(多言語対応。空で既定の日本語。全プラットフォーム共通)Confirm.setOptOutLabel(Text.get("confirm.dont_ask", "次回から確認しない"))
setTextkind, caption[, prompt]題と本文Confirm.setText(kind, caption[, prompt])
setTypekind, type種類Confirm.setType(kind, type)
showkind[, type]確認ダイアログを出す。結果は変数 confirm.result(1=はい / 0=いいえ)Confirm.show("titleExit")

Cursor (3)

座標は設計座標(1280×720)。窓の大きさに合わせて直してから動かします。

メソッド引数説明呼び出し例
moveTo(値)x, yカーソルをその位置へ動かす(1/0)Cursor.moveTo(x, y)
moveToAuto(値)x, y環境設定の「カーソルの自動移動」が入のときだけ、画面が出そろってから動かす(切なら 0)Cursor.moveToAuto(x, y)
moveToChoice(値)index表示中の選択肢(0 始まり)の中央へ動かす(1/0)Cursor.moveToChoice(index)

Debug (17)

実行モードが Release のときは、Debug の命令はすべて何もしません。console は Debug の別名です(console.log(x) は Debug.log(x) と同じ)。

メソッド引数説明呼び出し例
addBreakpointCommandcommand命令名でブレークDebug.addBreakpointCommand(command)
addBreakpointLabellabelラベルでブレークDebug.addBreakpointLabel(label)
assertcondition, message偽ならログへ出して失敗にするDebug.assert(condition, message)
break—Debug ビルドでブレークDebug.break()
clearBreakpoints—ブレークを全部消すDebug.clearBreakpoints()
hidetoolNameデバッグツールを隠すDebug.hide(toolName)
hideAll—デバッグツールを全部隠すDebug.hideAll()
initialize[scenarioDir, particleDir, macroDir]デバッグツールを使い始めるDebug.initialize([scenarioDir, particleDir, macroDir])
isAvailable(値)—デバッグツールが使えるかDebug.isAvailable()
logmessageログへ出すDebug.log(message)
requestBreak—次の命令で止めるDebug.requestBreak()
showtoolNameデバッグツールを出すDebug.show(toolName)
showAll—デバッグツールを全部出すDebug.showAll()
shutdown—デバッグツールを片付けるDebug.shutdown()
toggletoolName出す/隠すを切り替えるDebug.toggle(toolName)
trace—今の命令をログへ出すDebug.trace()
version—デバッグツールの版Debug.version()

Display (2)

メソッド引数説明呼び出し例
setContentAspectmode4:3 画面モード(Window.setContentAspect と同じ。0=ワイド / 1=スクエア / 2=自動)Display.setContentAspect(mode)
setScaleModemode拡大方法(Window.setScaleMode と同じ)Display.setScaleMode(mode)

Draw (6)

描いた図形は画面に残り続けます(場面の絵の上、メッセージ枠などの UI の下。タイトルの画面では背景の上、ボタンや文字の下)。消すときは Draw.clear() です。座標は設計座標(1280×720 などの設計解像度)です。RenderTarget の setActive(番号) の間は、その描き先へ描きます。Windows・Android・ブラウザで同じ動きです。

画面に描いた物は、シナリオの始まり・セーブの読み込み・タイトルへ戻るときに消えます(セーブには入りません。RenderTarget に描いた絵は消えません)。消さずに描き足し続けても重くなりません。画面の外の座標や極端に大きな数、数でない値は、無視するか範囲に収めて扱います。

メソッド引数説明呼び出し例
circlecx, cy[, radius, r, g, b, a, lineWidth]円の線Draw.circle(cx, cy[, radius, r, g, b, a, lineWidth])
clear[r, g, b, a]描き先を消す(引数なしで透明に戻す。色を渡すとその色で塗りつぶす。a を省くと 255)Draw.clear([r, g, b, a])
fillCirclecx, cy[, radius, r, g, b, a]塗りの円Draw.fillCircle(cx, cy[, radius, r, g, b, a])
fillRectx, y[, w, h, r, g, b, a]塗りの矩形Draw.fillRect(x, y[, w, h, r, g, b, a])
linex1, y1, x2, y2[, r, g, b, a, lineWidth]線Draw.line(x1, y1, x2, y2[, r, g, b, a, lineWidth])
rectx, y[, w, h, r, g, b, a, lineWidth]矩形の線Draw.rect(x, y[, w, h, r, g, b, a, lineWidth])

Easing (10)

t は進み具合 0.0〜1.0(範囲の外は丸める)。どれも計算した値を返します(LUMINA Script の式で使う。SimpleScript では受け取れない)。

メソッド引数説明呼び出し例
easeInCubic(値)t3 次の加速Easing.easeInCubic(t)
easeInOutCubic(値)t3 次の加速→減速Easing.easeInOutCubic(t)
easeInOutQuad(値)t2 次の加速→減速Easing.easeInOutQuad(t)
easeInQuad(値)t2 次の加速Easing.easeInQuad(t)
easeOutBack(値)t少し行き過ぎて戻るEasing.easeOutBack(t)
easeOutBounce(値)t弾んで止まるEasing.easeOutBounce(t)
easeOutCubic(値)t3 次の減速Easing.easeOutCubic(t)
easeOutElastic(値)tばねのように揺れて止まるEasing.easeOutElastic(t)
easeOutQuad(値)t2 次の減速Easing.easeOutQuad(t)
linear(値)t直線Easing.linear(t)

Effect (5)

メソッド引数説明呼び出し例
flashdurationMs[, r, g, b]画面を光らせる(色の既定は白)Effect.flash(durationMs[, r, g, b])
quakedurationMs[, strength]画面を揺らす(strength 既定 8)Effect.quake(durationMs[, strength])
setColorAdjust[brightness, contrast, saturation]明るさ・コントラスト・彩度(既定 0 / 1 / 1)Effect.setColorAdjust([brightness, contrast, saturation])
setGamma[value]ガンマ(既定 0.5)Effect.setGamma([value])
setSharpness[value]シャープネス(既定 0)Effect.setSharpness([value])

EventCG (9)

メソッド引数説明呼び出し例
changediffName, durationMs[, transitionType]差分へ切り替える(transitionType 既定 crossfade)EventCG.change(diffName, durationMs[, transitionType])
clear—消す(旧い書き方)EventCG.clear()
hide[durationMs]消すEventCG.hide([durationMs])
isAnimating(値)—動きの途中かEventCG.isAnimating()
layerbasePath, diffName, layerIdx, alpha, durationMs差分を重ねるEventCG.layer(basePath, diffName, layerIdx, alpha, durationMs)
movex, y, zoomPercent, durationMs位置と拡大率を動かすEventCG.move(x, y, zoomPercent, durationMs)
setBasefolder[, partName]ベースと差分を重ねて 1 枚にするためのベースを登録(フォルダの登録も兼ねる)EventCG.setBase(folder[, partName])
setFolderfolder名前だけで引けるようにフォルダを登録EventCG.setFolder(folder)
showpath[, durationMs]イベント CG を出すEventCG.show(path[, durationMs])

FX (19)

画像素材のいらない図形の演出です。id ごとに要素を作り、anim(出て・保って・消える)と transform(拡大・移動)で時間に載せます。作った要素は消すまで毎コマ描かれます。座標は基準解像度(既定 1280×720)。色は "#AARRGGBB" / "0xAARRGGBB" / 整数で書けます(省略は白)。softness は縁のぼかし、thickness が 0 以下だと塗りつぶしです。

メソッド引数説明呼び出し例
animid[, fadeInMs, holdMs, fadeOutMs, easing, delayMs]出る→保つ→消えるの時間(easing 既定 1。delayMs で始まりをずらす)FX.anim(id[, fadeInMs, holdMs, fadeOutMs, easing, delayMs])
arcid, cx, cy, radius, startDeg, endDeg[, thickness, color, softness, taper]円弧(角度は 0=右 / 90=下。taper 1 で両端が尖る)FX.arc(id, cx, cy, radius, startDeg, endDeg[, thickness, color, softness, taper])
beginBatch—要素をまとめて作り始める(endBatch まで描かない。転送を 1 回にまとめる)FX.beginBatch()
blendid, mode合成方法(0=通常 / 2=加算)FX.blend(id, mode)
boltid, x1, y1, x2, y2[, amp, segs, seed, thickness, color, softness]稲妻・ヒビ(折れの振れ幅・数・形の種)FX.bolt(id, x1, y1, x2, y2[, amp, segs, seed, thickness, color, softness])
circleid, cx, cy, radius[, thickness, color, softness]円・輪FX.circle(id, cx, cy, radius[, thickness, color, softness])
clearid要素を消すFX.clear(id)
clearAll—要素を全部消すFX.clearAll()
endBatch—まとめて作るのを終えるFX.endBatch()
heartid, cx, cy[, radius, thickness, color, softness]ハート(既定 半径 40・塗り・ピンク)FX.heart(id, cx, cy[, radius, thickness, color, softness])
imageid, path, x, y[, w, h]絵を要素にする(anim / transform で図形と同じく動かせる。w, h が 0 以下なら実寸)FX.image(id, path, x, y[, w, h])
lineid, x1, y1, x2, y2[, thickness, color, softness]線FX.line(id, x1, y1, x2, y2[, thickness, color, softness])
polygonid, cx, cy, radius[, sides, skip, rotDeg, thickness, color, softness]多角形・星形(skip 1 で正多角形、5, 2 で五芒星。既定 5, 2, -90)FX.polygon(id, cx, cy, radius[, sides, skip, rotDeg, thickness, color, softness])
radialid, cx, cy, innerR, outerR[, count, thickness, color, softness]放射線(集中線)FX.radial(id, cx, cy, innerR, outerR[, count, thickness, color, softness])
rectid, x, y, w, h[, color, softness]矩形FX.rect(id, x, y, w, h[, color, softness])
setDesignSize[w, h]座標の基準解像度(既定 1280×720)FX.setDesignSize([w, h])
spinid[, degPerSec, startDeg]回し続ける(正で時計回り、0 で止める)FX.spin(id[, degPerSec, startDeg])
transformid[, scaleFrom, scaleTo, dx, dy, durationMs, easing, delayMs]拡大と移動を時間をかけて(easing 既定 1)FX.transform(id[, scaleFrom, scaleTo, dx, dy, durationMs, easing, delayMs])
zigzagid, cx, cy, radius[, amp, teeth, rotDeg, thickness, color, softness]ギザギザの輪FX.zigzag(id, cx, cy, radius[, amp, teeth, rotDeg, thickness, color, softness])
メソッド引数説明呼び出し例
cgGetList—解放済み CG の ID 一覧(カンマ区切り)Gallery.cgGetList()
cgGetMaskcgId解放済みの差分(bit N = 差分 N)Gallery.cgGetMask(cgId)
cgIsUnlockedcgId[, diffIndex]解放済みかGallery.cgIsUnlocked(cgId[, diffIndex])
cgUnlockcgId[, diffIndex]CG(差分)を解放するGallery.cgUnlock(cgId[, diffIndex])
load—解放状況を読み直すGallery.load()
save—解放状況を保存するGallery.save()
sceneIsUnlockedsceneIdシーンが解放済みかGallery.sceneIsUnlocked(sceneId)
sceneRegistersceneId, title[, startLabel, scriptFile]シーンを登録するGallery.sceneRegister(sceneId, title[, startLabel, scriptFile])
sceneUnlocksceneIdシーンを解放するGallery.sceneUnlock(sceneId)

Input (84)

ADV 入力のポーリング API です。playerIndex は省略で 0。マウスの座標は設計座標(1280×720)です。

メソッド引数説明呼び出し例
disableRelativeMouseMode—相対マウスモードを切るInput.disableRelativeMouseMode()
enableRelativeMouseMode—相対マウスモード(移動量だけを取る)Input.enableRelativeMouseMode()
getAccelerometerX(値)[playerIndex]加速度センサー XInput.getAccelerometerX([playerIndex])
getAccelerometerY(値)[playerIndex]加速度センサー YInput.getAccelerometerY([playerIndex])
getAccelerometerZ(値)[playerIndex]加速度センサー ZInput.getAccelerometerZ([playerIndex])
getConnectedControllerCount(値)—つながっているコントローラーの数Input.getConnectedControllerCount()
getControllerBackend(値)[playerIndex]コントローラーの入力の仕組みInput.getControllerBackend([playerIndex])
getCursorMode(値)—カーソルモードInput.getCursorMode()
getGyroscopeX(値)[playerIndex]ジャイロ XInput.getGyroscopeX([playerIndex])
getGyroscopeY(値)[playerIndex]ジャイロ YInput.getGyroscopeY([playerIndex])
getGyroscopeZ(値)[playerIndex]ジャイロ ZInput.getGyroscopeZ([playerIndex])
getLeftStickX(値)[playerIndex]左スティック XInput.getLeftStickX([playerIndex])
getLeftStickY(値)[playerIndex]左スティック YInput.getLeftStickY([playerIndex])
getLeftTrigger(値)[playerIndex]左トリガーInput.getLeftTrigger([playerIndex])
getMouseDelta—マウスの移動量Input.getMouseDelta()
getMouseX(値)—マウスの XInput.getMouseX()
getMouseY(値)—マウスの YInput.getMouseY()
getPinchScale(値)—ピンチの拡大率Input.getPinchScale()
getRightStickX(値)[playerIndex]右スティック XInput.getRightStickX([playerIndex])
getRightStickY(値)[playerIndex]右スティック YInput.getRightStickY([playerIndex])
getRightTrigger(値)[playerIndex]右トリガーInput.getRightTrigger([playerIndex])
getSwipeDirection(値)—スワイプの向き(ジェスチャが切なら 0)Input.getSwipeDirection()
getTiltPitch(値)[playerIndex]傾き(ピッチ)Input.getTiltPitch([playerIndex])
getTiltRoll(値)[playerIndex]傾き(ロール)Input.getTiltRoll([playerIndex])
getTiltYaw(値)[playerIndex]傾き(ヨー)Input.getTiltYaw([playerIndex])
getTouchCount(値)—タッチの数Input.getTouchCount()
getTouchX(値)[index]タッチの XInput.getTouchX([index])
getTouchY(値)[index]タッチの YInput.getTouchY([index])
hasGesture(値)—ジェスチャがあったか(環境設定のマウスジェスチャが切なら無し)Input.hasGesture()
hideCursor—カーソルを隠すInput.hideCursor()
hitTest(値)x, y, w, hマウスがその矩形の中にあるか(1/0)Input.hitTest(x, y, w, h)
isAdvanceTextRequested(値)—文字送りInput.isAdvanceTextRequested()
isAnyClicked(値)—左右どちらかがクリックされたかInput.isAnyClicked()
isAutoModeRequested(値)—オートモードInput.isAutoModeRequested()
isBacklogRequested(値)—バックログInput.isBacklogRequested()
isCancelRequested(値)—キャンセルInput.isCancelRequested()
isCommandExecuted(値)cmdId[, playerIndex]コマンド入力が成立したかInput.isCommandExecuted(cmdId[, playerIndex])
isControllerConnected(値)[playerIndex]コントローラーがつながっているかInput.isControllerConnected([playerIndex])
isDoubleTapped(値)—ダブルタップInput.isDoubleTapped()
isDownRequested(値)—下Input.isDownRequested()
isFullscreenToggleRequested(値)—フルスクリーン切替Input.isFullscreenToggleRequested()
isGamepadConnected(値)[varName]ゲームパッドがつながっているか(1/0。9.9 のゲームパッド)。SimpleScript では varName の変数へ入るInput.isGamepadConnected([varName])
isLeftClicked(値)—左クリックInput.isLeftClicked()
isLeftPressed(値)—左ボタンを押しているInput.isLeftPressed()
isLeftRequested(値)—左Input.isLeftRequested()
isMotionSensorAvailable(値)[playerIndex]モーションセンサーが使えるかInput.isMotionSensorAvailable([playerIndex])
isMouseClicked(値)—クリックされたか(1/0)Input.isMouseClicked()
isMouseDown(値)—左ボタンを押しているか(1/0)Input.isMouseDown()
isPlayingBack(値)—入力の再生中かInput.isPlayingBack()
isQuickLoadRequested(値)—クイックロードInput.isQuickLoadRequested()
isQuickSaveRequested(値)—クイックセーブInput.isQuickSaveRequested()
isRecording(値)—入力の記録中かInput.isRecording()
isRightClicked(値)—右クリックInput.isRightClicked()
isRightMouseDown(値)—右ボタンを押しているか(1/0)Input.isRightMouseDown()
isRightPressed(値)—右ボタンを押しているInput.isRightPressed()
isRightRequested(値)—右Input.isRightRequested()
isScreenshotRequested(値)—スクリーンショットInput.isScreenshotRequested()
isSelectRequested(値)—決定Input.isSelectRequested()
isSkipHeld(値)—スキップを押し続けているInput.isSkipHeld()
isSkipRequested(値)—スキップInput.isSkipRequested()
isSystemMenuRequested(値)—システムメニューInput.isSystemMenuRequested()
isTapped(値)—タップInput.isTapped()
isUpRequested(値)—上Input.isUpRequested()
isVoiceReplayRequested(値)—ボイスの再生し直しInput.isVoiceReplayRequested()
loadRecordingpath入力の記録を読み込むInput.loadRecording(path)
lockCursor—カーソルを窓の中に閉じ込めるInput.lockCursor()
registerCommandnotation, nameコマンド入力を登録(格闘ゲーム向け)Input.registerCommand(notation, name)
registerPresetCommands—定番のコマンド入力を登録Input.registerPresetCommands()
saveRecordingpath入力の記録を保存Input.saveRecording(path)
setCursorModemodeマウスカーソル制御Input.setCursorMode(mode)
setGamepadEnabledonゲームパッドで操作するか(1/0。既定は 1。割り当ては 9.9 のゲームパッド)Input.setGamepadEnabled(on)
setGestureActiondir[, actionId]ジェスチャの向き("up" / "down" / "left" / "right" / "wheelup")に操作 ID(メッセージ枠のボタンと同じ qsave / auto / backlog など)を割り当てる。空でその向きは何もしないInput.setGestureAction(dir[, actionId])
setGestureDecoration[veil, ring, center, plate, plateSelected]ジェスチャの輪の見た目の絵(暗幕・輪・中心・板・選択中の板。空の飾りは出ない)Input.setGestureDecoration([veil, ring, center, plate, plateSelected])
setGestureImagedir[, path]押している間に輪に出す絵(空でその向きは出さない)Input.setGestureImage(dir[, path])
setVibration[playerIndex, left, right]振動(左右のモーターの強さ)Input.setVibration([playerIndex, left, right])
showCursor—カーソルを出すInput.showCursor()
startPlayback—記録した入力を再生Input.startPlayback()
startRecording[seed]入力の記録を始めるInput.startRecording([seed])
stopAllVibration—振動を全部止めるInput.stopAllVibration()
stopPlayback—再生を止めるInput.stopPlayback()
stopRecording—記録を止めるInput.stopRecording()
stopVibration[playerIndex]振動を止めるInput.stopVibration([playerIndex])
unlockCursor—カーソルの閉じ込めを外すInput.unlockCursor()
update—入力を更新Input.update()

InputUtility (5)

メソッド引数説明呼び出し例
getRemap(値)actionId操作の割り当てを読むInputUtility.getRemap(actionId)
getTextBuffer(値)—入力された文字InputUtility.getTextBuffer()
isDoubleClick(値)lastClickTime, nowTime, intervalSecダブルクリックか(interval 既定 0.3 秒)InputUtility.isDoubleClick(lastClickTime, nowTime, intervalSec)
isLongPress(値)pressed, pressTime, thresholdSec長押しか(threshold 既定 0.5 秒)InputUtility.isLongPress(pressed, pressTime, thresholdSec)
setRemapactionId, keyOrButton操作の割り当てを変えるInputUtility.setRemap(actionId, keyOrButton)

JSON (2)

どちらも値を返します。

メソッド引数説明呼び出し例
parsestrJSON 文字列を値にするJSON.parse(str)
stringifyvalue値を JSON 文字列にするJSON.stringify(value)

以前この表に載せていた JSON.isArray はありません(呼んでも undefined)。配列かどうかは Array.isArray(x) で調べます。

LipSync (6)

メソッド引数説明呼び出し例
getAutoEnabled(値のみ)—ボイスに合わせた自動口パクが有効か(1/0)LipSync.getAutoEnabled()
isActive(値)charaId口パク中か(1/0)LipSync.isActive(charaId)
registerPartscharaId, part...口パクに使う差分を登録LipSync.registerParts(charaId, part...)
setAutoEnabled[on]ボイスに合わせた自動口パクの入切(既定 入)LipSync.setAutoEnabled([on])
startcharaId口パクを始めるLipSync.start(charaId)
stopcharaId口パクを止めるLipSync.stop(charaId)

Math (28)

どれも値を返します(Math のメソッドは命令を通さずに計算します)。

メソッド引数説明呼び出し例
absx絶対値Math.abs(x)
acosx逆余弦Math.acos(x)
asinx逆正弦Math.asin(x)
atanx逆正接Math.atan(x)
atan2y, x2 引数の逆正接Math.atan2(y, x)
cbrtx立方根Math.cbrt(x)
ceilx切り上げMath.ceil(x)
cosx余弦Math.cos(x)
expxe の x 乗Math.exp(x)
floorx切り捨てMath.floor(x)
hypotx, y√(x² + y²)Math.hypot(x, y)
logx自然対数Math.log(x)
log10x常用対数Math.log10(x)
log2x2 を底とする対数Math.log2(x)
maxx, y...最大Math.max(x, y...)
minx, y...最小Math.min(x, y...)
mtRandom[max] または [min, max]MT19937 の乱数(引数なしで 0〜1 未満、あれば整数)Math.mtRandom([max])
mtRandomSeedseedMT19937 の種Math.mtRandomSeed(seed)
powx, yx の y 乗Math.pow(x, y)
random[max] または [min, max]乱数(引数なしで 0〜1 未満、max だけなら 0〜max、2 つなら min〜max の整数)Math.random([max])
randomSeedseedrandom の種Math.randomSeed(seed)
roundx四捨五入Math.round(x)
seedAllseed両方の乱数の種をまとめて決めるMath.seedAll(seed)
signx符号(1 / 0 / -1)Math.sign(x)
sinx正弦Math.sin(x)
sqrtx平方根Math.sqrt(x)
tanx正接Math.tan(x)
truncx小数部を捨てるMath.trunc(x)

定数はプロパティで読めます: Math.PI / Math.E / Math.LN2 / Math.LN10 / Math.SQRT2 / Math.SQRT1_2。

Menu (16)

メソッド引数説明呼び出し例
addItemparent, title[, action]項目を足すMenu.addItem(parent, title[, action])
addMenupath または parent, titleサブメニューを足す("親/子" の 1 引数でも書ける)Menu.addMenu(path)
addMenuBarShowHideItemsparentメニューバーの表示/非表示の項目を足すMenu.addMenuBarShowHideItems(parent)
addSeparatorparent区切り線Menu.addSeparator(parent)
apply—組んだメニューを反映Menu.apply()
begintitle構築ブロックを始めるMenu.begin(title)
clear—メニューを全部消すMenu.clear()
debugState—メニューの状態をログへ出すMenu.debugState()
end—構築ブロックを終えるMenu.end()
forceShow—メニューを付け直して出すMenu.forceShow()
handleidregister したハンドラを実行Menu.handle(id)
itemtitle, action項目(ブロック内)Menu.item(title, action)
registerid, actionハンドラを登録Menu.register(id, action)
separator—区切り線(ブロック内)Menu.separator()
setupdefinition定義からまとめて組むMenu.setup(definition)
setVisiblevisible[, force]表示切替(起動中は無視されることがあるので、確実に変えるときは force=true)Menu.setVisible(visible[, force])

MenuBar (20)

メソッド引数説明呼び出し例
addButtonactionId, x, y, normal, rollover, active, inactiveボタンを追加MenuBar.addButton(actionId, x, y, normal, rollover, active, inactive)
apply—設定を反映MenuBar.apply()
clearButtons—ボタンを全部消すMenuBar.clearButtons()
getMode(値)—setActive の値MenuBar.getMode()
hide—隠すMenuBar.hide()
isActive(値)—有効かMenuBar.isActive()
registeractionId, handlerCodeボタンのハンドラを登録MenuBar.register(actionId, handlerCode)
setActivemode出す場面(0=出さない / 1=シナリオ中 / 2=システム画面(ロゴ・タイトル) / 3=両方)MenuBar.setActive(mode)
setBackgroundpath背景画像MenuBar.setBackground(path)
setButtonEnabledactionId[, enabled]ボタン有効化MenuBar.setButtonEnabled(actionId[, enabled])
setDisplayModemode"slide" か 0 = スライド式(既定) / "inplace" か 1 = その場表示(透明度で出し入れ)MenuBar.setDisplayMode(mode)
setHotZoneHeight[h]上端の反応する高さ(既定 10)MenuBar.setHotZoneHeight([h])
setInplaceAlphaidleAlpha, activeAlphaその場表示の透明度(非ホバー時 既定 0.3 / ホバー時 既定 1.0)MenuBar.setInplaceAlpha(idleAlpha, activeAlpha)
setLogopath[, x, y]ロゴ画像MenuBar.setLogo(path[, x, y])
setScopescope"scenario" か 0 = シナリオ実行中だけ(既定) / "system" か 1 = システムスクリプト実行中だけ / "both" か 2 = 両方MenuBar.setScope(scope)
setSlideDuration[ms]スライドの時間(既定 250)MenuBar.setSlideDuration([ms])
setSounds[hoverSE, clickSE]ボタン SEMenuBar.setSounds([hoverSE, clickSE])
setSystemFilterfilter0 か "all" = すべてのシステム画面 / 1 か "logo" / 2 か "title" / 3 = ロゴとタイトルMenuBar.setSystemFilter(filter)
setSystemTagtag0=なし / 1=logo / 2=titleMenuBar.setSystemTag(tag)
show—出すMenuBar.show()

MessageWindow (6)

メソッド引数説明呼び出し例
completeText—文字送りを最後まで出すMessageWindow.completeText()
getTextSpeed(値)—文字送りの速さMessageWindow.getTextSpeed()
invokeactionIdregister したハンドラを実行MessageWindow.invoke(actionId)
isTextComplete(値)—文字送りが終わったかMessageWindow.isTextComplete()
registeractionId, codeボタンのハンドラを登録MessageWindow.register(actionId, code)
setTextSpeed[ms]文字送りの速さMessageWindow.setTextSpeed([ms])

Motion (55)

mrumotion プラグインが必要です。handle は createInstance が返す番号です。playMotionEx 以降に足した命令(繋ぎ・まばたき・口パク・パーツ・当たり判定)は apiVersion() が 2 以上のときだけ効きます(古い DLL では何もしない)。

メソッド引数説明呼び出し例
apiVersion(値のみ)—プラグインの API 版(1 = 旧 DLL / 2 以上で新しい命令が使える)Motion.apiVersion()
clearExpressionhandle表情を外すMotion.clearExpression(handle)
createInstance(値)modelName[, varName]インスタンスを作り番号を返す。SimpleScript では varName の変数へ入るMotion.createInstance(modelName[, varName])
destroyAll—インスタンスを全部消すMotion.destroyAll()
destroyInstancehandleインスタンスを消すMotion.destroyInstance(handle)
getAutoBlink(値のみ)handle自動まばたきが入か(1/0)Motion.getAutoBlink(handle)
getCanvasSize(値)modelName画布の大きさ(LUMINA Script では "幅x高さ" の文字列)Motion.getCanvasSize(modelName)
getCurrentMotionName(値のみ)handle再生中のモーション名Motion.getCurrentMotionName(handle)
getHitAreaCount(値のみ)modelName当たり領域の数Motion.getHitAreaCount(modelName)
getHitAreaName(値のみ)modelName, index当たり領域の名前Motion.getHitAreaName(modelName, index)
getInstanceCount(値のみ)—インスタンスの数Motion.getInstanceCount()
getLipSync(値のみ)handleリップシンクが入か(1/0)Motion.getLipSync(handle)
getLipSyncValue(値のみ)handle今の口の開き(0〜1)Motion.getLipSyncValue(handle)
getParameter(値)handle, paramNameパラメータを読むMotion.getParameter(handle, paramName)
getPartCount(値のみ)modelNameパーツの数Motion.getPartCount(modelName)
getPartId(値のみ)modelName, indexパーツ IDMotion.getPartId(modelName, index)
getPartOpacity(値のみ)handle, partIdパーツの不透明度Motion.getPartOpacity(handle, partId)
hasInstances(値のみ)—インスタンスがあるか(1/0)Motion.hasInstances()
hitTest(値のみ)handle, x, y当たった領域名(外れは空文字)Motion.hitTest(handle, x, y)
hitTestArea(値のみ)handle, areaName, x, yその領域に当たったか(1/0)Motion.hitTestArea(handle, areaName, x, y)
isFinished(値)handleモーションが終わったか(1/0)Motion.isFinished(handle)
isPlaying(値)handleモーション再生中か(1/0)Motion.isPlaying(handle)
loadExpressionmodelName, exprPath表情を読み込むMotion.loadExpression(modelName, exprPath)
loadModel(値)name, jsonPathモデルを読み込む。LUMINA Script では読めたら 1、読めなければ 0Motion.loadModel(name, jsonPath)
loadMotionmodelName, motionPathモーションを読み込むMotion.loadMotion(modelName, motionPath)
playMotionhandle, motionName[, speed]モーションを再生(すぐ差し替える)Motion.playMotion(handle, motionName[, speed])
playMotionExhandle, motionName[, speed, fadeInMs, fadeOutMs, loop]繋ぎ方を指定して再生(fadeInMs が負なら定義どおり、fadeOutMs が負なら fadeInMs と同じ。loop は -1=定義どおり / 0 / 1)Motion.playMotionEx(handle, motionName[, speed, fadeInMs, fadeOutMs, loop])
renderBackend(値のみ)—描画の方式(0=ソフト / 1=GPU D3D12 / 2=GPU D3D11 / 3=GPU GLES。確認用)Motion.renderBackend()
resetParametershandleパラメータを初期値へMotion.resetParameters(handle)
resetPhysicshandle揺れ物の物理を初期状態へ戻すMotion.resetPhysics(handle)
set3Dhandle[, depthScale, perspective]疑似3D の効き(1, 1 = モデルどおり / depthScale 0 = 平面)Motion.set3D(handle[, depthScale, perspective])
setAlphahandle, alpha不透明度Motion.setAlpha(handle, alpha)
setAutoBlinkhandle, on自動まばたきの入切Motion.setAutoBlink(handle, on)
setAutoBlinkParamshandle, csvまばたきで動かすパラメータ(カンマ区切り)Motion.setAutoBlinkParams(handle, csv)
setAutoBlinkTiminghandle, minMs, maxMs[, closeMs, holdMs, openMs]まばたきの間合い(負の値は変えない)Motion.setAutoBlinkTiming(handle, minMs, maxMs[, closeMs, holdMs, openMs])
setDrawOrderhandle, order描画順Motion.setDrawOrder(handle, order)
setExpressionhandle, name表情を切り替えるMotion.setExpression(handle, name)
setGlobalWindwx, wy全体の風Motion.setGlobalWind(wx, wy)
setLipSynchandle, onリップシンクの入切Motion.setLipSync(handle, on)
setLipSyncParamshandle, csv口パクで動かすパラメータ(カンマ区切り)Motion.setLipSyncParams(handle, csv)
setLipSyncTuninghandle, gain[, smoothing, decayPerSec]口の開きの効き方(負の値は変えない)Motion.setLipSyncTuning(handle, gain[, smoothing, decayPerSec])
setLipSyncValuehandle, level声の大きさ(0〜1)を渡す(毎フレーム)Motion.setLipSyncValue(handle, level)
setMotionFadehandle, fadeInMs繋ぎ時間の既定値(モーションの定義に無いとき使う)Motion.setMotionFade(handle, fadeInMs)
setParameterhandle, paramName, valueパラメータ制御(メッシュ変形)Motion.setParameter(handle, paramName, value)
setParthandle, partId, visibleパーツを表にする(同じ組の他のパーツは消える)Motion.setPart(handle, partId, visible)
setPartOpacityhandle, partId, alphaパーツの不透明度Motion.setPartOpacity(handle, partId, alpha)
setPositionhandle, x, y位置Motion.setPosition(handle, x, y)
setScalehandle, sx, sy拡大率Motion.setScale(handle, sx, sy)
setVisiblehandle, visible表示切替Motion.setVisible(handle, visible)
setVoiceLipSynchandle再生中の声の大きさを毎フレーム流し込む相手(0 で解除)Motion.setVoiceLipSync(handle)
setWindhandle, wx, wy風(揺れ物)Motion.setWind(handle, wx, wy)
stopMotionhandleモーションを止めるMotion.stopMotion(handle)
stopMotionFadehandle[, fadeOutMs]時間をかけて止める(既定 300、0 で即)Motion.stopMotionFade(handle[, fadeOutMs])
unloadAll—モデルを全部破棄するMotion.unloadAll()
unloadModelnameモデルを破棄するMotion.unloadModel(name)

Movie (18)

メソッド引数説明呼び出し例
animateViewportx, y, w, h, durationMs再生枠を今の位置からその枠まで滑らかに動かすMovie.animateViewport(x, y, w, h, durationMs)
getDurationMs(値のみ)—総再生時間(ms)Movie.getDurationMs()
getPositionMs(値のみ)—再生位置(ms)Movie.getPositionMs()
isPlaying(値)—再生中か(1/0)Movie.isPlaying()
pause—一時停止Movie.pause()
playpath[, x, y, mask, async]動画を再生(終わりまで待つには Common.WaitMovieEnd)Movie.play(path[, x, y, mask, async])
preload(値)path再生はせず下ごしらえだけ済ませる。LUMINA Script では総再生時間(ms)を返すMovie.preload(path)
resume—再開Movie.resume()
seekms再生位置Movie.seek(ms)
SetCancelModemodesetCancelMode と同じMovie.SetCancelMode(mode)
setCancelModemode飛ばし方Movie.setCancelMode(mode)
setFullscreen[on]1 で画面いっぱいへ戻す(枠の指定を外す)Movie.setFullscreen([on])
setLoopingloopループMovie.setLooping(loop)
setRaterate再生速度Movie.setRate(rate)
setupdefinition定義をまとめて設定Movie.setup(definition)
setViewportx, y, w, h設計座標の枠の中で再生する(周りのボタンや文字が見えたまま)Movie.setViewport(x, y, w, h)
setVolumevolume音量Movie.setVolume(volume)
stop—停止Movie.stop()

Particle (17)

メソッド引数説明呼び出し例
fadeOut[ms]薄くしながら止める(画面のフェードアウトと一緒に消すとき。0 で stop と同じ)Particle.fadeOut([ms])
getLayer(値)—描く層の名前Particle.getLayer()
getLoaded(値)—読み込んだ素材の名前Particle.getLoaded()
isActive(値)—動いているかParticle.isActive()
loadassetパーティクル素材を読み込むParticle.load(asset)
play[count]読み込んだ素材を再生(count 既定 -1)Particle.play([count])
playAssetasset[, count]素材を読み込んで再生Particle.playAsset(asset[, count])
rain[count]雨(既定 150)Particle.rain([count])
sakura[count]桜(既定 80)Particle.sakura([count])
setColor[r, g, b, a]色(既定 255, 255, 255, 200)Particle.setColor([r, g, b, a])
setLayerlayerName描く層Particle.setLayer(layerName)
setSize[minSize, maxSize]粒の大きさ(既定 2〜6)Particle.setSize([minSize, maxSize])
setSpeed[speed]速さ(既定 1.0)Particle.setSpeed([speed])
setWind[wx, wy]風Particle.setWind([wx, wy])
snow[count]雪(既定 100)Particle.snow([count])
start[type, count]プリセットを始める(type 0=雪 / 1=雨 / 2=桜、count 既定 100)Particle.start([type, count])
stop—その場で止める(粒はすぐ消える)Particle.stop()

QuickResume (3)

メソッド引数説明呼び出し例
exists(値)—再開用データがあるか(1/0)QuickResume.exists()
load—再開用データを読み込んでシナリオを再開する(バックログ・画面の状態も戻す)QuickResume.load()
save—今のシナリオの状態を再開用に保存するQuickResume.save()

QuickSave (1)

メソッド引数説明呼び出し例
exists(値)—クイックセーブがあるか(1/0)QuickSave.exists()

RegExp (3)

正規表現は /pattern/flags か new RegExp(pattern, flags) で作ります。flags は g / i / m。文字列の match / search / replace / split にも渡せます。どれも値を返します。replace・split・match(g)は JavaScript と同じ動きです(空の一致は 1 文字進めて続ける、置き換えの文字で $&・$1・$`・$'・$$ が使える、split は括弧の中身も入れる)。

メソッド引数説明呼び出し例
execstr最初の一致([全体, グループ…]、index 付き)。合わなければ nullre.exec(str)
teststr合うか(true/false)re.test(str)
toString—"/pattern/flags" の文字列re.toString()

RenderTarget (4)

同時に作れるのは 64 枚まで、画素の合計は 4096×4096 までです。超えると create は 0 を返します(作れない)。要らなくなった描き先は destroy(番号) で捨ててください。描き先の絵は、シナリオの始まりやセーブの読み込みでも消えません。

メソッド引数説明呼び出し例
create(値)[w, h]描き先(画布)を作り番号を返す(既定 256×256。0 は失敗)。setActive(番号) の間は Draw.* がそこへ描くRenderTarget.create([w, h])
destroyrtId描画先を捨てるRenderTarget.destroy(rtId)
getTexture(値)rtId描画先のテクスチャ番号。この番号は Title.addSprite など、テクスチャ番号を受け取る口にそのまま置ける。中身を描き足しても、Title.clear の後でも番号は同じで、同じ絵が出る。数そのものに意味は無い(Windows では 1073741825 のような大きな数、Android・ブラウザでは小さな数)RenderTarget.getTexture(rtId)
setActivertId描く先を切り替える(0 で画面へ戻す)RenderTarget.setActive(rtId)

SaveSlot (20)

スロットの本編セーブは saveState / loadState / hasState です。save / load はスロットに付ける小さな値(鍵と値の文字列)の読み書きです。

メソッド引数説明呼び出し例
copySlotfrom, to中身を丸ごと複製(コピー先は上書き。元が空なら失敗)SaveSlot.copySlot(from, to)
deleteslotスロットを消す(見出し・本体・サムネイル)。空のスロットでも成功扱いSaveSlot.delete(slot)
deleteThumbnailslotサムネイルを消すSaveSlot.deleteThumbnail(slot)
exists(値)slotスロットにデータがあるか(1/0)SaveSlot.exists(slot)
getMaxSlots(値)—最大スロット数SaveSlot.getMaxSlots()
getNewestSlot(値)[base, count]いちばん新しいスロット(無ければ -1)。範囲を渡すとその中だけで探すSaveSlot.getNewestSlot([base, count])
getSeriesBase(値)namesetSeries で決めた先頭の番号SaveSlot.getSeriesBase(name)
getSeriesMax(値)namesetSeries で決めた保持数SaveSlot.getSeriesMax(name)
getTimestamp(値)slot保存日時の文字列SaveSlot.getTimestamp(slot)
hasState(値)slot本編セーブ(進行状況)があるか(1/0)。見出しではなく本体を見るSaveSlot.hasState(slot)
hasThumbnail(値)slotサムネイルがあるか(1/0)SaveSlot.hasThumbnail(slot)
load(値)slot, keyスロットに付けた値を読む。LUMINA Script では文字列を返すSaveSlot.load(slot, key)
loadStateslot本編セーブを読み込んで再開する(オート・スキップ・シーン送りは止める)SaveSlot.loadState(slot)
loadThumbnail(値)slotサムネイルを読み込み、テクスチャ番号を返すSaveSlot.loadThumbnail(slot)
saveslot, key, valueスロットに値を付けるSaveSlot.save(slot, key, value)
saveStateslot本編セーブ(クイックセーブと同じ内容)をスロットへ書くSaveSlot.saveState(slot)
saveThumbnail(値)slot[, w, h]今の画面のサムネイルを保存(既定 320×180)SaveSlot.saveThumbnail(slot[, w, h])
setMaxSlots[max]最大スロット数(既定 20)SaveSlot.setMaxSlots([max])
setSeriesname, base, maxクイックセーブ/オートセーブの履歴を置く番号の範囲と保持数(通常のページと重ならない番号にする)SaveSlot.setSeries(name, base, max)
swapSlota, b2 つを入れ替える(片方が空なら移動)SaveSlot.swapSlot(a, b)

Scenario (2)

メソッド引数説明呼び出し例
loadpathシナリオを読み込んで始める(シナリオ変数は消さない)Scenario.load(path)
playpathload と同じScenario.play(path)

Scene3D (128)

3D 場面(glTF 2.0 / GLB・基本形状・ライト・スキニング)を描き、背景レイヤーへ合成します。別 DLL ではありません。3D が使えない環境では begin が 0 を返し、2D はそのまま動きます。番号(形・素材・置いた物・モデル・アクター・剛体)は作る命令の戻り値で受け取るので、作る命令は LUMINA Script で値として使います。コマ数は 1/60 秒、効き(easing)は Bg と同じ番号(0=直線 / 1=減速 / 2=加速 / 3=両端ゆるやか)。角度は度。

開始と場面

メソッド引数説明呼び出し例
addLighttype, x, y, z, dx, dy, dz, r, g, b, intensity光を足す(最大 8。type 0=平行光 / 1=点光源 / 2=スポット)Scene3D.addLight(type, x, y, z, dx, dy, dz, r, g, b, intensity)
attach(値)layer描いた絵を背景レイヤー(0〜19)へ載せる(1/0)Scene3D.attach(layer)
begin(値)w, h3D を使い始める(描画先の大きさ。既定 1280×720。使えなければ 0)Scene3D.begin(w, h)
clearLights—光を全部消すScene3D.clearLights()
drawCount(値のみ)—直前のコマで描いた件数(確認用)Scene3D.drawCount()
end—3D をやめる(置いた物・作った形も捨てる)Scene3D.end()
isReady(値のみ)—使える状態か(1/0)Scene3D.isReady()
setActive[on]描くのを止める/再開する(置いた物は残る)Scene3D.setActive([on])
setAmbientr, g, b環境光(0〜255)Scene3D.setAmbient(r, g, b)
setBloom[on, threshold, strength, passes]明るい所を滲ませる(既定 0.75 / 0.8 / 2)Scene3D.setBloom([on, threshold, strength, passes])
setCameraeyeX, eyeY, eyeZ, targetX, targetY, targetZ, fovYカメラ(位置・見る先・縦の画角)Scene3D.setCamera(eyeX, eyeY, eyeZ, targetX, targetY, targetZ, fovY)
setClearColorr, g, b, a背景の塗り(a 0 で透明=2D が透ける)Scene3D.setClearColor(r, g, b, a)
setEnvironmentskyR, skyG, skyB, groundR, groundG, groundB, intensity周りの映り込み(空と地面の 2 色。金属の見え方が決まる)Scene3D.setEnvironment(skyR, skyG, skyB, groundR, groundG, groundB, intensity)
setFog[on, r, g, b, start, end]フォグScene3D.setFog([on, r, g, b, start, end])
setFrustumCulling[on]見えない物を描かない(既定 入)Scene3D.setFrustumCulling([on])
setMsaasamples輪郭のギザギザを均す(1 / 2 / 4 / 8。既定 4)Scene3D.setMsaa(samples)
setShadow[on, mapSize, distance, strength]影(平行光 1 つぶん)Scene3D.setShadow([on, mapSize, distance, strength])
setSky[on, 天頂 r, g, b, 地平線 r, g, b, 足元 r, g, b, sunSize]空のグラデーションと太陽の大きさScene3D.setSky([on, 天頂 r, g, b, 地平線 r, g, b, 足元 r, g, b, sunSize])
takeDeviceLost(値のみ)—画面の作り直しで場面が捨てられたか(1 なら組み直す。読むと戻る)Scene3D.takeDeviceLost()

形・素材・置く

メソッド引数説明呼び出し例
addItem(値のみ)meshId[, materialId]形を場面へ置き、物の番号を返す(0 は失敗)Scene3D.addItem(meshId[, materialId])
clearItems—置いた物を全部消す(形と素材は残る)Scene3D.clearItems()
createAnnulus(値のみ)[inner, outer, segments, startDeg]平らな輪を作るScene3D.createAnnulus([inner, outer, segments, startDeg])
createBox(値のみ)[size]箱を作るScene3D.createBox([size])
createCylinder(値のみ)[radius, height, slices]円柱を作るScene3D.createCylinder([radius, height, slices])
createMaterial(値のみ)[r, g, b, a, metallic, roughness]素材を作る(色 0〜255、金属度・粗さ 0〜1)Scene3D.createMaterial([r, g, b, a, metallic, roughness])
createPlane(値のみ)[width, depth, uvTile]板を作るScene3D.createPlane([width, depth, uvTile])
createQuad(値のみ)[width, height]四角を作るScene3D.createQuad([width, height])
createRing(値のみ)[inner, outer, depth, segments, startDeg]厚みのある輪を作るScene3D.createRing([inner, outer, depth, segments, startDeg])
createSphere(値のみ)[radius, slices, stacks]球を作るScene3D.createSphere([radius, slices, stacks])
setItemOpacityitem, opacity物の不透明度Scene3D.setItemOpacity(item, opacity)
setItemShadowitem[, cast, receive]物の影(落とす/受ける)Scene3D.setItemShadow(item[, cast, receive])
setItemTransformitem, x, y, z, pitch, yaw, roll, sx, sy, sz物の位置・向き・大きさScene3D.setItemTransform(item, x, y, z, pitch, yaw, roll, sx, sy, sz)
setItemVisibleitem[, on]物の表示Scene3D.setItemVisible(item[, on])
setMaterialEmissivematerial, r, g, b, strength自己発光Scene3D.setMaterialEmissive(material, r, g, b, strength)
setMaterialTexturematerial, path, slot素材に絵を貼る(slot 0=基本色 / 1=法線 / 2=ORM / 3=発光)Scene3D.setMaterialTexture(material, path, slot)
setMaterialUnlitmaterial[, on]光を当てずにそのまま塗るScene3D.setMaterialUnlit(material[, on])

時間で動かす

メソッド引数説明呼び出し例
spinItemitem, pitchPerSec, yawPerSec, rollPerSec回し続ける(全部 0 で止める)Scene3D.spinItem(item, pitchPerSec, yawPerSec, rollPerSec)
stopTweens—時間で動く物を全部止める(姿勢はそのまま)Scene3D.stopTweens()
tweenCameraeyeX, eyeY, eyeZ, targetX, targetY, targetZ, frames, easingカメラを今の位置から動かすScene3D.tweenCamera(eyeX, eyeY, eyeZ, targetX, targetY, targetZ, frames, easing)
tweenItemitem, x, y, z, pitch, yaw, roll, sx, sy, sz, frames, easing物を目標の姿勢へ動かすScene3D.tweenItem(item, x, y, z, pitch, yaw, roll, sx, sy, sz, frames, easing)
tweenItemOpacityitem, opacity, frames, easing物の不透明度を変えるScene3D.tweenItemOpacity(item, opacity, frames, easing)
tweenLightDirectionindex, dx, dy, dz, frames, easing光の向きを振るScene3D.tweenLightDirection(index, dx, dy, dz, frames, easing)

モデル(glTF 2.0 / GLB)

メソッド引数説明呼び出し例
addModel(値)model読んだモデルを場面へ置く(置いた部品の数。0 は失敗)Scene3D.addModel(model)
findModelAnimation(値のみ)model, name名前から動きの番号を引く(無ければ -1)Scene3D.findModelAnimation(model, name)
findModelByPath(値のみ)pathloadModel した場所からモデルの番号を引くScene3D.findModelByPath(path)
loadModel(値)pathモデルを読み、番号を返す(0 は失敗。読むだけでは出ない)Scene3D.loadModel(path)
modelAnimationCount(値のみ)model動きの本数Scene3D.modelAnimationCount(model)
modelAnimationTime(値のみ)model動きの再生位置Scene3D.modelAnimationTime(model)
modelPartCount(値のみ)model置いた部品の数Scene3D.modelPartCount(model)
modelSize(値のみ)model包む箱の対角の長さ(カメラの引きの目安)Scene3D.modelSize(model)
playModelAnimation(値)model, index[, loop]動きを再生(index -1 で止めて元の姿勢へ)Scene3D.playModelAnimation(model, index[, loop])
playModelAnimationFade(値)model, index[, loop, fadeSec]動きを繋いで切り替える(既定 0.2 秒)Scene3D.playModelAnimationFade(model, index[, loop, fadeSec])
setModelAnimationSpeed(値)model, speed動きの速さScene3D.setModelAnimationSpeed(model, speed)
setModelTransformmodel, x, y, z, pitch, yaw, roll, sx, sy, szモデル全体の位置・向き・大きさScene3D.setModelTransform(model, x, y, z, pitch, yaw, roll, sx, sy, sz)
setModelVisiblemodel[, on]モデルの表示Scene3D.setModelVisible(model[, on])

3D アクション(プレイヤー・カメラ・武器・HUD)

メソッド引数説明呼び出し例
actionReset—アクションの状態(当たり・アクター・HUD)を全部捨てるScene3D.actionReset()
aliveEnemyCount(値のみ)—生きている敵の数Scene3D.aliveEnemyCount()
lastActionEvent(値のみ)index直前の runAction 中に起きた(戻らなかった)出来事Scene3D.lastActionEvent(index)
lastActionEventCount(値のみ)—その数Scene3D.lastActionEventCount()
playerHp(値のみ)—プレイヤーの HPScene3D.playerHp()
playerKills(値のみ)—倒した数Scene3D.playerKills()
playerScore(値のみ)—得点Scene3D.playerScore()
playerX(値のみ)—プレイヤーの XScene3D.playerX()
playerY(値のみ)—プレイヤーの YScene3D.playerY()
playerYaw(値のみ)—プレイヤーの向きScene3D.playerYaw()
playerZ(値のみ)—プレイヤーの ZScene3D.playerZ()
pushActionEventname[, returnToScript]スクリプトから出来事を積む(次の runAction で返る)Scene3D.pushActionEvent(name[, returnToScript])
runAction(値)[maxMs]出来事が起きるまで遊ばせる(待つ)。"trigger:名前" / "pickup:名前" / "interact:名前" / "kill:名前" / "dead" / "cleared" / "custom:名前" / "timeout" / "cancel"(Esc)を返すScene3D.runAction([maxMs])
setCameraModemode, eyeHeight, tpsDistance, tpsHeight, fovYカメラ(0=一人称 / 1=三人称。0 以下の値は変えない)Scene3D.setCameraMode(mode, eyeHeight, tpsDistance, tpsHeight, fovY)
setClearedEvent[on, returnToScript]敵が全滅したら "cleared" を出すScene3D.setClearedEvent([on, returnToScript])
setHud[crosshair, hpBar]照準と HP バーを出すかScene3D.setHud([crosshair, hpBar])
setHudTextid, text, x, y[, size, r, g, b, seconds]HUD の文字(同じ id は差し替え、空で消す)Scene3D.setHudText(id, text, x, y[, size, r, g, b, seconds])
setLookSensitivityperPixel[, invertY]視線の感度と上下反転Scene3D.setLookSensitivity(perPixel[, invertY])
setPlayerModelmodel[, yawOffset]三人称で描くプレイヤーのモデルScene3D.setPlayerModel(model[, yawOffset])
setPlayerParamsradius, height, stepHeight, slopeLimit, gravity, jumpSpeedプレイヤーの寸法と動き(0 の項目は変えない)Scene3D.setPlayerParams(radius, height, stepHeight, slopeLimit, gravity, jumpSpeed)
setPlayerStartx, y, z, yaw出発点と向きScene3D.setPlayerStart(x, y, z, yaw)
setPlayerStatshp, maxHp, walkSpeed, sprintSpeedHP と速さScene3D.setPlayerStats(hp, maxHp, walkSpeed, sprintSpeed)
setWeapondamage, range, interval, spread[, automatic, ammo]武器(ammo -1 で無限)Scene3D.setWeapon(damage, range, interval, spread[, automatic, ammo])

当たりとアクター

メソッド引数説明呼び出し例
actorActive(値のみ)idアクターが動いているかScene3D.actorActive(id)
actorAlive(値のみ)idアクターが生きているかScene3D.actorAlive(id)
actorHp(値のみ)idアクターの HPScene3D.actorHp(id)
actorX(値のみ)idアクターの XScene3D.actorX(id)
actorY(値のみ)idアクターの YScene3D.actorY(id)
actorZ(値のみ)idアクターの ZScene3D.actorZ(id)
addActor(値)kind, name, x, y, z, yaw[, hx, hy, hz]アクターを置き番号を返す(kind は "enemy" / "pickup" / "trigger" / "npc" / "prop" / "static")Scene3D.addActor(kind, name, x, y, z, yaw[, hx, hy, hz])
addModelCollider(値)modelモデルの三角形を当たりにする(三角形の数)Scene3D.addModelCollider(model)
addStaticBox(値)cx, cy, cz, w, h, d[, material, uvPerMeter]直方体を当たり付きで置く(物の番号)Scene3D.addStaticBox(cx, cy, cz, w, h, d[, material, uvPerMeter])
addStaticItem(値)mesh, material, x, y, z, pitch, yaw, roll, sx, sy, sz作った形を当たり付きで置く(物の番号)Scene3D.addStaticItem(mesh, material, x, y, z, pitch, yaw, roll, sx, sy, sz)
findActor(値のみ)name名前からアクターの番号を引くScene3D.findActor(name)
setActorActive(値)id[, on]アクターを動かす/止めるScene3D.setActorActive(id[, on])
setActorEvent(値)id, eventName[, returnToScript, once]起きたときの出来事の名前Scene3D.setActorEvent(id, eventName[, returnToScript, once])
setActorParams(値)id, hp, speed, sightRange, attackRange, damage, attackInterval, radius, height敵などの性質(0 以下の項目は変えない)Scene3D.setActorParams(id, hp, speed, sightRange, attackRange, damage, attackInterval, radius, height)
setActorPickup(値)id, score, heal, ammo拾い物の効果Scene3D.setActorPickup(id, score, heal, ammo)
setActorPosition(値)id, x, y, z, yawアクターの位置Scene3D.setActorPosition(id, x, y, z, yaw)
setActorVisual(値)id, model, item, yawOffset, offX, offY, offZ, scaleアクターの見た目(使わない方は 0)Scene3D.setActorVisual(id, model, item, yawOffset, offX, offY, offZ, scale)

地形・広い世界・インスタンス

メソッド引数説明呼び出し例
addInstanceColliders(値)item, kind, radius, height置いたインスタンス全部に当たり(0=カプセル / 1=箱)Scene3D.addInstanceColliders(item, kind, radius, height)
addStreamedModel(値)path, x, y, z, yaw, scale, radius[, collider]近づいたら読んで置き、離れたら捨てるモデル(登録番号)Scene3D.addStreamedModel(path, x, y, z, yaw, scale, radius[, collider])
buildNavGrid(値)cellSize, minX, minZ, maxX, maxZ, minY, maxY敵の経路の地図を作る(置き終わってから。歩ける升目の数)Scene3D.buildNavGrid(cellSize, minX, minZ, maxX, maxZ, minY, maxY)
createInstances(値)mesh, material[, capacity]同じ形を大量に置く入れ物(物の番号)Scene3D.createInstances(mesh, material[, capacity])
createTerrainFromImage(値)path, sizeX, sizeZ, height, chunk, material, uvPerMeter絵の明るさを高さにした地形(区画の数)Scene3D.createTerrainFromImage(path, sizeX, sizeZ, height, chunk, material, uvPerMeter)
createTerrainNoise(値)samples, sizeX, sizeZ, height, chunk, material, uvPerMeter, seed, roughnessノイズの地形(区画の数)Scene3D.createTerrainNoise(samples, sizeX, sizeZ, height, chunk, material, uvPerMeter, seed, roughness)
setActorGroup(値)actor, groupアクターを組に入れるScene3D.setActorGroup(actor, group)
setGroupgroup, cx, cy, cz, radius組(距離で出し入れ)の中心と半径Scene3D.setGroup(group, cx, cy, cz, radius)
setInstance(値)item, index, x, y, z, pitch, yaw, roll, scaleインスタンス 1 つの姿勢Scene3D.setInstance(item, index, x, y, z, pitch, yaw, roll, scale)
setInstanceCount(値)item, count描くインスタンスの数Scene3D.setInstanceCount(item, count)
setItemGroup(値)item, group物を組に入れるScene3D.setItemGroup(item, group)
setItemLod(値)item, mesh1, dist1, mesh2, dist2距離で形を差し替える(LOD)Scene3D.setItemLod(item, mesh1, dist1, mesh2, dist2)
streamedLoadedCount(値のみ)—読み込まれているストリーミングのモデル数Scene3D.streamedLoadedCount()
streamedModelHandle(値のみ)id登録番号から、読み込まれたモデルの番号を引くScene3D.streamedModelHandle(id)
terrainHeight(値のみ)x, z地形の高さScene3D.terrainHeight(x, z)
terrainSlope(値のみ)x, z地形の傾き(0=平ら〜1=垂直)Scene3D.terrainSlope(x, z)

物理(剛体・拘束・ラグドール)

メソッド引数説明呼び出し例
addBody(値)shape, x, y, z, sx, sy, sz[, mass, restitution, friction]剛体を置き番号を返す(shape 0=球 / 1=箱 / 2=カプセル。mass 0 で動かない)Scene3D.addBody(shape, x, y, z, sx, sy, sz[, mass, restitution, friction])
addJoint(値)type, bodyA, bodyB, ax, ay, az, bx, by, bz, param, axisX, axisY, axisZ拘束(type 0=球関節 / 1=距離 / 2=蝶番。bodyA 0 = 世界)Scene3D.addJoint(type, bodyA, bodyB, ax, ay, az, bx, by, bz, param, axisX, axisY, axisZ)
addRagdoll(値)model[, totalMass, minBone, coneDeg, radiusRatio]皮のあるモデルの骨をラグドールにする(作った剛体の数)Scene3D.addRagdoll(model[, totalMass, minBone, coneDeg, radiusRatio])
applyImpulse(値)body, ix, iy, iz力積を与えるScene3D.applyImpulse(body, ix, iy, iz)
bodyAwake(値のみ)body動いているかScene3D.bodyAwake(body)
bodyX(値のみ)body剛体の XScene3D.bodyX(body)
bodyY(値のみ)body剛体の YScene3D.bodyY(body)
bodyZ(値のみ)body剛体の ZScene3D.bodyZ(body)
impulseRagdollmodel, ix, iy, izラグドールに力積を与えるScene3D.impulseRagdoll(model, ix, iy, iz)
lastShotBody(値のみ)—直前の弾が当たった剛体Scene3D.lastShotBody()
removeBodybody剛体を消すScene3D.removeBody(body)
removeRagdoll(値)modelラグドールを外して元の骨へ戻す(消した剛体の数)Scene3D.removeRagdoll(model)
setBodyPosition(値)body, x, y, z剛体の位置Scene3D.setBodyPosition(body, x, y, z)
setBodyVelocity(値)body, vx, vy, vz剛体の速度Scene3D.setBodyVelocity(body, vx, vy, vz)
setBodyVisual(値)body, item, model[, sx, sy, sz]剛体の見た目(物かモデル。使わない方は 0)Scene3D.setBodyVisual(body, item, model[, sx, sy, sz])
setGravity[gx, gy, gz]重力(既定 0, -9.81, 0)Scene3D.setGravity([gx, gy, gz])
setWeaponImpulse[impulse]弾が剛体に当たったときの力積(既定 6)Scene3D.setWeaponImpulse([impulse])

Scissor (2)

メソッド引数説明呼び出し例
disable—切り抜きをやめるScissor.disable()
setx, y[, w, h]描く範囲を矩形で切り抜く(w, h 既定 100)Scissor.set(x, y[, w, h])

Screen (13)

名前付きの画面(フローチャート・マップ・ステータス画面などの土台)を作り、背景・画像ボタン・ラベル・ゲージを置いて show で出します。show は選ばれるまで待ち、選ばれたボタンの actionId を返します(キャンセルは空文字)。座標は設計座標(1280×720)、色は "#AARRGGBB" / "0xAARRGGBB" / 整数。

キーとゲームパッドでの操作: show で出した画面(フローチャート・マップ・ステータス・育成の予定表など。Windows 以外では確認ダイアログも)は、矢印キー(Windows・Android)やパッドの十字キーで、その向きにある近いボタンへ印を移せます(印はマウスを乗せたときと同じ hover の絵)。Enter(Windows はスペースも)・パッドの A で印のボタンを選びます。印が無いときの Enter / A は、最初のボタンに印を付けるだけで選びません。無効なボタンは飛ばします。右クリック・Esc・パッドの B / START で取り消すと空文字で閉じます(確認ダイアログでは「いいえ」)。Windows 以外では、画面を出している間は右クリック(長押し)で取り消し、ホイールは使いません。

メソッド引数説明呼び出し例
addButtonname, actionId, x, y, normal[, hover, pressed, disabled]画像ボタンを置く(省いた絵は normal を使う)Screen.addButton(name, actionId, x, y, normal[, hover, pressed, disabled])
addGaugename, id, x, y, w, h[, value, bgColor, fillColor]ゲージ(value 0〜1)Screen.addGauge(name, id, x, y, w, h[, value, bgColor, fillColor])
addLabelname, id, x, y, w, h, text[, fontSize, color, bold]文字ラベル(fontSize 既定 20)Screen.addLabel(name, id, x, y, w, h, text[, fontSize, color, bold])
clearname背景とボタンを全部消すScreen.clear(name)
clearButtonsnameボタンだけ消すScreen.clearButtons(name)
createname画面を作る(あれば何もしない)Screen.create(name)
destroyname画面を捨てるScreen.destroy(name)
isVisible(値)—出ているか(1/0)Screen.isVisible()
setBackgroundname, path背景画像Screen.setBackground(name, path)
setButtonEnabledname, actionId, enabledボタンの有効/無効Screen.setButtonEnabled(name, actionId, enabled)
setGaugeValuename, id, valueゲージの値を変えるScreen.setGaugeValue(name, id, value)
setLabelTextname, id, textラベルの文字を変えるScreen.setLabelText(name, id, text)
show(値)name画面を出し、選ばれたボタンの actionId を返すvar picked = Screen.show("map")

Scripts (2)

メソッド引数説明呼び出し例
execStoragepathスクリプトファイルを実行するScripts.execStorage(path)
preloadpath実行せずに読み込み・復号・解析だけ先に済ませる(失敗しても止めない)Scripts.preload(path)

拡張子を省くと、設定したシステムスクリプトの拡張子(System.setExtension("systemScript", …))を付けて探します。.txt と .lsf が両方あるときは更新日時の新しい方、片方しか無ければある方を使います。

Select (22)

show は選ばれるまで待ち、LUMINA Script では選ばれた識別子を返します(あとから getSelected / getSelectedIndex でも読めます)。制限時間を付けるときは、show の前に setTimeLimit を呼びます。残り時間の帯が選択肢の上に出て、時間切れになると既定の選択肢を選んだことになります。セーブ画面などを開いている間は時間が止まります。シナリオから使う場合は select_timeout。


// @lumina
Select.clear();
Select.add("はい", "yes");
Select.add("いいえ", "no");
Select.setTimeLimit(5000, 1);    // 5 秒で決まらなければ 2 番目(0 始まりで 1)
var picked = Select.show();      // 選ばれた識別子("yes" / "no")
if (Select.wasTimedOut()) {
    System.debugLog("時間切れ: " + picked);
}
メソッド引数説明呼び出し例
addtext[, actionId, enabled]文字の選択肢を足す(actionId 既定は text)Select.add(text[, actionId, enabled])
addImageactionId, x, y, normal, hover, pressed, disabled[, enabled]画像の選択肢を足すSelect.addImage(actionId, x, y, normal, hover, pressed, disabled[, enabled])
clear—選択肢を全部消すSelect.clear()
getSelected(値)—選ばれた選択肢の識別子Select.getSelected()
getSelectedIndex(値)—選ばれた選択肢の番号Select.getSelectedIndex()
setDefaultImagesnormal, hover, pressed, disabledボタンの既定の絵Select.setDefaultImages(normal, hover, pressed, disabled)
setDefaultTextArea[offX, offY, w, h]文字を置く範囲の既定(ボタンの中)Select.setDefaultTextArea([offX, offY, w, h])
setEnabledid, enabledその選択肢の有効/無効Select.setEnabled(id, enabled)
setFont[name, size, bold, color]書体・大きさ・太字・色(既定 Meiryo / 24 / 0 / 白)Select.setFont([name, size, bold, color])
setFontColorDisabledcolor無効の文字色Select.setFontColorDisabled(color)
setFontColorHovercolorホバー時の文字色Select.setFontColorHover(color)
setHideAnimationid, type[, duration, delay]消すときの動き(既定 300ms)Select.setHideAnimation(id, type[, duration, delay])
setImagesid, normal, hover, pressed, disabledその選択肢の絵Select.setImages(id, normal, hover, pressed, disabled)
setLayout[x, y, spacing]並べる位置と間隔(-1 は自動)Select.setLayout([x, y, spacing])
setPositionid, x, yその選択肢の位置Select.setPosition(id, x, y)
setShowAnimationid, type[, duration, delay]出すときの動き(既定 300ms)Select.setShowAnimation(id, type[, duration, delay])
setSounds[hover, click, cancel]ボタン SESelect.setSounds([hover, click, cancel])
setTextAreaid, offX, offY, w, hその選択肢の文字の範囲Select.setTextArea(id, offX, offY, w, h)
setTextPosition[x, y, w, lineH]文字の選択肢の位置と行の高さSelect.setTextPosition([x, y, w, lineH])
setTimeLimitms[, defaultIndex]次の show 1 回だけに制限時間を付ける(0 以下で取り消し)。時間切れで defaultIndex(0 始まり。既定 0。範囲外・無効なら有効な最初の選択肢)を選んだことにするSelect.setTimeLimit(ms[, defaultIndex])
show(値)—選択肢を出して、選ばれるまで待つ。LUMINA Script では選ばれた識別子を返すvar picked = Select.show()
wasTimedOut(値)[varName]直前の show が時間切れで決まったか(1/0)。SimpleScript では varName の変数へ入るSelect.wasTimedOut([varName])

Sound (88)

Sound.bgm.play(...) のような小分けの書き方(bgm.* / se.* / voice.* / sysse.* / sysvoice.* / ducking.*)は、同じ行の平らな名前(playBgm など)と同じ動きです。ただし値を返すのは平らな名前だけです(Sound.isVoicePlaying() は値を返し、Sound.voice.isPlaying() は返さない)。音量は 0〜100、定位(pan)は -100〜100 です。

.wav の BGM の速さ・高さ: Windows の .wav の曲は、setBgmTempo / setBgmPitch を変えると 0.3 秒ほどで効きます。変えたまま曲を替えたときの鳴り始めや、seekBgm も同じです。ゲームは止まりません。16bit の PCM 以外の .wav は、曲全体を作り終えてから(長い曲で 1〜2 秒)効きます。.ogg・.opus の曲はすぐに効きます。

メソッド引数説明呼び出し例
bgm.fadevolume, durationMsfadeBgm と同じSound.bgm.fade(volume, durationMs)
bgm.pause—pauseBgm と同じSound.bgm.pause()
bgm.playpathplayBgm と同じSound.bgm.play(path)
bgm.pushSegmentpath[, crossFade]pushBgmSegment と同じSound.bgm.pushSegment(path[, crossFade])
bgm.resume—resumeBgm と同じSound.bgm.resume()
bgm.seekmsseekBgm と同じSound.bgm.seek(ms)
bgm.setBaseDirdirsetBgmBaseDir と同じSound.bgm.setBaseDir(dir)
bgm.setLooploopsetBgmLoop と同じSound.bgm.setLoop(loop)
bgm.setPanpansetBgmPan と同じSound.bgm.setPan(pan)
bgm.setVolumevolumesetBgmVolume と同じSound.bgm.setVolume(volume)
bgm.stop—stopBgm と同じSound.bgm.stop()
clearSeCache—SE の控えを全部捨てるSound.clearSeCache()
ducking.setEnabledonsetDuckingEnabled と同じSound.ducking.setEnabled(on)
ducking.setFadefadeInMs, fadeOutMssetDuckingFade と同じSound.ducking.setFade(fadeInMs, fadeOutMs)
ducking.setVolumevolumesetDuckingVolume と同じSound.ducking.setVolume(volume)
fadeBgmvolume, durationMsBGM の音量をフェードSound.fadeBgm(volume, durationMs)
getBgmDurationMs(値のみ)—BGM の曲の長さ(ms。読み込み前は 0)Sound.getBgmDurationMs()
getBgmPositionMs(値のみ)—BGM の再生位置(ms)Sound.getBgmPositionMs()
getSysSeVolume(値)—システム効果音の音量Sound.getSysSeVolume()
getSysVoiceVolume(値)—システム音声の音量Sound.getSysVoiceVolume()
getVoiceLevel(値のみ)—声の大きさ(口パク用。-1 は測れない)Sound.getVoiceLevel()
getVoicePositionMs(値)—ボイスの再生位置(ms)Sound.getVoicePositionMs()
getVoiceTotalMs(値)—ボイスの長さ(ms)Sound.getVoiceTotalMs()
isVoicePlaying(値)—ボイス再生中か(1/0)Sound.isVoicePlaying()
pause—汎用音を一時停止Sound.pause()
pauseBgm—BGM を一時停止Sound.pauseBgm()
pauseVoice—ボイスを一時停止Sound.pauseVoice()
playpath汎用の音を鳴らすSound.play(path)
playBgmpathBGM を再生Sound.playBgm(path)
playSepathSE を再生Sound.playSe(path)
playSeLooppathSE をループ再生Sound.playSeLoop(path)
playVoicepathボイスを再生Sound.playVoice(path)
preloadSepathSE を先に読み込むSound.preloadSe(path)
pushBgmSegmentpath[, crossFade]次に続けて流す BGM の区間を積むSound.pushBgmSegment(path[, crossFade])
resumeBgm—BGM を再開Sound.resumeBgm()
resumeVoice—ボイスを再開Sound.resumeVoice()
se.clearCache—clearSeCache と同じSound.se.clearCache()
se.playpathplaySe と同じSound.se.play(path)
se.playLooppathplaySeLoop と同じSound.se.playLoop(path)
se.preloadpathpreloadSe と同じSound.se.preload(path)
se.setBaseDirdirsetSeBaseDir と同じSound.se.setBaseDir(dir)
se.setPanpansetSePan と同じSound.se.setPan(pan)
se.setVolumevolumesetSeVolume と同じSound.se.setVolume(volume)
se.stop—stopSe と同じ(SE を全部止める)Sound.se.stop()
se.stopAll—stopAllSe と同じSound.se.stopAll()
se.unloadpathunloadSe と同じSound.se.unload(path)
seekBgmmsBGM の再生位置Sound.seekBgm(ms)
setBgmBaseDirdirBGM のフォルダSound.setBgmBaseDir(dir)
setBgmLooploopBGM のループSound.setBgmLoop(loop)
setBgmPanpanBGM の定位Sound.setBgmPan(pan)
setBgmPitchsemitoneBGM の音程(半音単位の整数)。鳴っている曲にもその場で効き、曲を替えても残る(Windows の .ogg・.opus・.wav、Android、ブラウザとも)。高さを変えても速さは変わらないSound.setBgmPitch(semitone)
setBgmTempopercentBGM の速さ。百分率で渡す(100 = 等速、120 = 1.2 倍)。小数点の付いた値(1.2 など)は倍率として受け取る。鳴っている曲にもその場で効き、曲を替えても残る(Windows の .ogg・.opus・.wav、Android、ブラウザとも)。速さを変えても高さは変わらないSound.setBgmTempo(percent)
setBgmVolumevolumeBGM の音量Sound.setBgmVolume(volume)
setDuckingEnabledonボイス中に BGM を下げるかSound.setDuckingEnabled(on)
setDuckingFadefadeInMs, fadeOutMs下げる/戻す時間Sound.setDuckingFade(fadeInMs, fadeOutMs)
setDuckingVolumevolume下げた音量(既定 30)Sound.setDuckingVolume(volume)
setMasterVolumevolume全体の音量Sound.setMasterVolume(volume)
setSeBaseDirdirSE のフォルダSound.setSeBaseDir(dir)
setSePanpanSE の定位Sound.setSePan(pan)
setSeVolumevolumeSE の音量Sound.setSeVolume(volume)
setSysSeVolumevolumeシステム効果音(UI のホバー・決定・取消)の音量。場面の SE とは別Sound.setSysSeVolume(volume)
setSysVoiceVolumevolumeシステム音声(UI の読み上げ)の音量。場面のボイスとは別Sound.setSysVoiceVolume(volume)
setVoiceCharaScalepercent話者ごとの音量の割合。設定のボイス音量とは別に持つSound.setVoiceCharaScale(percent)
setVoicePanpanボイスの定位Sound.setVoicePan(pan)
setVoiceVolumevolumeボイスの音量Sound.setVoiceVolume(volume)
setVolumevolume汎用音の音量Sound.setVolume(volume)
stop—汎用音を止めるSound.stop()
stopAllSe—SE を全部止めるSound.stopAllSe()
stopBgm—BGM を止めるSound.stopBgm()
stopSe—SE を全部止める(stopAllSe と同じ)Sound.stopSe()
stopVoice—ボイスを止めるSound.stopVoice()
sysse.getVolume(値)—getSysSeVolume と同じSound.sysse.getVolume()
sysse.playnameシステム効果音を専用のフォルダと音量で鳴らすSound.sysse.play(name)
sysse.setVolumevolumesetSysSeVolume と同じSound.sysse.setVolume(volume)
sysvoice.getVolume(値)—getSysVoiceVolume と同じSound.sysvoice.getVolume()
sysvoice.playnameシステム音声を専用のフォルダと音量で鳴らすSound.sysvoice.play(name)
sysvoice.setVolumevolumesetSysVoiceVolume と同じSound.sysvoice.setVolume(volume)
unloadSepathSE の控えを捨てるSound.unloadSe(path)
voice.getPositionMs—getVoicePositionMs と同じ(値は返さない)Sound.voice.getPositionMs()
voice.getTotalMs—getVoiceTotalMs と同じ(値は返さない)Sound.voice.getTotalMs()
voice.isPlaying—isVoicePlaying と同じ(値は返さない)Sound.voice.isPlaying()
voice.pause—pauseVoice と同じSound.voice.pause()
voice.playpathplayVoice と同じSound.voice.play(path)
voice.resume—resumeVoice と同じSound.voice.resume()
voice.setCharaScalepercentsetVoiceCharaScale と同じSound.voice.setCharaScale(percent)
voice.setPanpansetVoicePan と同じSound.voice.setPan(pan)
voice.setVolumevolumesetVoiceVolume と同じSound.voice.setVolume(volume)
voice.stop—stopVoice と同じSound.voice.stop()

Sound.BGM (5)

メソッド引数説明呼び出し例
pause—BGM を一時停止Sound.BGM.pause()
playpathBGM を再生Sound.BGM.play(path)
resume—BGM を再開Sound.BGM.resume()
setVolumevolumeBGM の音量Sound.BGM.setVolume(volume)
stop—BGM を止めるSound.BGM.stop()

Sound.SE (4)

メソッド引数説明呼び出し例
playpathSE を再生Sound.SE.play(path)
setVolumevolumeSE の音量Sound.SE.setVolume(volume)
stop—SE を全部止める(stopAll と同じ)Sound.SE.stop()
stopAll—SE を全部止めるSound.SE.stopAll()

Sprite (9)

メソッド引数説明呼び出し例
changelayer, path[, x, y]絵を差し替えるSprite.change(layer, path[, x, y])
clear—全部消す(clearAll と同じ)Sprite.clear()
clearAll—全部消すSprite.clearAll()
hidelayer消すSprite.hide(layer)
movelayer, x, yすぐ動かすSprite.move(layer, x, y)
moveTolayer, x, y[, durationMs]時間をかけて動かす(既定 500)Sprite.moveTo(layer, x, y[, durationMs])
setAlphalayer, alpha不透明度(0〜100)Sprite.setAlpha(layer, alpha)
setTextureFilterlayer, filter拡大縮小の補間(-1=既定 / 0=Point / 1=Linear / 2=Anisotropic)Sprite.setTextureFilter(layer, filter)
showlayer, path[, x, y]絵を出すSprite.show(layer, path[, x, y])

SpriteSheet (1)

メソッド引数説明呼び出し例
drawlayer, path, srcX, srcY, srcW, srcH, dstX, dstY, dstW[, dstH]絵の一部を切り出して描く(dstH 既定は srcH)SpriteSheet.draw(layer, path, srcX, srcY, srcW, srcH, dstX, dstY, dstW[, dstH])

Steam (26)

Steam 版の機能です(mrusteam.dll が要ります)。取得系は LUMINA Script では値を返します。SimpleScript では最後の引数に変数名を書くと、そこへ結果が入ります(数は System の整数変数、名前と言語は文字列変数)。例: Steam.getAchievement("ACH_CLEAR", "ach.clear"); のあと System.ifVarEquals("ach.clear", 1, "...") で分岐できます。

メソッド引数説明呼び出し例
activateOverlaydialogオーバーレイを開くSteam.activateOverlay(dialog)
activateOverlayToWebPageurlオーバーレイでページを開くSteam.activateOverlayToWebPage(url)
clearAchievementname実績を取り消すSteam.clearAchievement(name)
cloudDeletefilenameクラウドのファイルを消すSteam.cloudDelete(filename)
cloudFileExists(値)filename[, varName]クラウドにファイルがあるか(1/0)Steam.cloudFileExists(filename[, varName])
findLeaderboard(値)nameリーダーボードを探す(LUMINA Script では探し始められたら 1。結果は後から届く)Steam.findLeaderboard(name)
getAchievement(値)name[, varName]実績を取ったか(1/0)Steam.getAchievement(name[, varName])
getCurrentGameLanguage(値)[varName]ゲームの言語Steam.getCurrentGameLanguage([varName])
getDlcCount(値)[varName]DLC の数Steam.getDlcCount([varName])
getNumAchievements(値)[varName]実績の数Steam.getNumAchievements([varName])
getPersonaName(値)[varName]ユーザーの表示名Steam.getPersonaName([varName])
getStatFloat(値)name[, varName]統計(小数)。SimpleScript では整数変数に整数部、同じ名前の文字列変数に小数のまま(例 "12.5")が入るSteam.getStatFloat(name[, varName])
getStatInt(値)name[, varName]統計(整数)Steam.getStatInt(name[, varName])
getSteamId(値)[varName]ユーザーの ID(17 桁)。LUMINA Script では文字で返る。SimpleScript では同じ名前の文字列変数に全桁、整数変数には下位 31 ビットが入るSteam.getSteamId([varName])
indicateProgressname, current, max実績の進み具合を出すSteam.indicateProgress(name, current, max)
initappId使い始めるSteam.init(appId)
isDlcInstalled(値)dlcAppId[, varName]DLC が入っているか(1/0)Steam.isDlcInstalled(dlcAppId[, varName])
isInitialized(値)[varName]使い始めたか(1/0)Steam.isInitialized([varName])
isOverlayEnabled(値)[varName]オーバーレイが使えるか(1/0)Steam.isOverlayEnabled([varName])
runCallbacks—届いた知らせを処理するSteam.runCallbacks()
setAchievementname実績を解除するSteam.setAchievement(name)
setStatFloatname, value統計(小数)を書くSteam.setStatFloat(name, value)
setStatIntname, value統計(整数)を書くSteam.setStatInt(name, value)
shutdown—片付けるSteam.shutdown()
storeStats—実績・統計を送るSteam.storeStats()
uploadLeaderboardScorescore得点を送るSteam.uploadLeaderboardScore(score)

Storages (5)

メソッド引数説明呼び出し例
addAutoPathpathリソース自動検索パス追加Storages.addAutoPath(path)
clearAutoPath—検索パスクリア(上書きフォルダは消えない)Storages.clearAutoPath()
getOverlay(値のみ)—いまの上書きフォルダ(切っていれば空)Storages.getOverlay()
isExistentStorage(値)pathそのファイルがあるか(1/0)。上書きフォルダ → 検索パス → データの根 → パックの中の順に探すStorages.isExistentStorage("data0/system/DevMode.txt")
setOverlaydir上書きフォルダ(データの根起点、例 data0/lang/en)。空で切るStorages.setOverlay("data0/lang/en")

String (23)

文字列の値に対して "abc".trim() や s.split(",") のように呼ぶメソッドです(String.trim() とは書きません)。どれも値を返します。文字の位置・長さは UTF-8 の 1 文字を 1 と数えます。長さは s.length で読めます。

メソッド引数説明呼び出し例
charAtindexその位置の 1 文字str.charAt(index)
charCodeAtindexその位置の文字コードstr.charCodeAt(index)
endsWithsuffixその文字で終わるかstr.endsWith(suffix)
includesneedle含むかstr.includes(needle)
indexOfneedle[, start]位置(無ければ -1)str.indexOf(needle[, start])
lastIndexOfneedle後ろから探した位置str.lastIndexOf(needle)
matchregexp正規表現に合った部分。g 付きなら合った文字列の配列、無ければ最初の一致([全体, グループ…]、index 付き)。合わなければ nullstr.match(regexp)
padEndlength[, pad]後ろを埋めて長さをそろえるstr.padEnd(length[, pad])
padStartlength[, pad]前を埋めて長さをそろえるstr.padStart(length[, pad])
repeatcount繰り返すstr.repeat(count)
replacefrom, to最初の 1 つを置き換える(from が正規表現で g 付きなら全部)str.replace(from, to)
replaceAllfrom, to全部置き換えるstr.replaceAll(from, to)
searchregexp正規表現に最初に合った位置(無ければ -1)str.search(regexp)
slicestart[, end]部分文字列(負は後ろから)str.slice(start[, end])
splitsep分割して配列にする(sep は文字列か正規表現。空文字で 1 文字ずつ)str.split(sep)
startsWithprefixその文字で始まるかstr.startsWith(prefix)
substringstart[, end]部分文字列str.substring(start[, end])
toLowerCase—小文字にする(英字のみ)str.toLowerCase()
toString—そのまま返すstr.toString()
toUpperCase—大文字にする(英字のみ)str.toUpperCase()
trim—前後の空白を除くstr.trim()
trimEnd—後ろの空白を除くstr.trimEnd()
trimStart—前の空白を除くstr.trimStart()

Suspend (2)

メソッド引数説明呼び出し例
exists(値)—中断データがあるか(1/0)Suspend.exists()
load—中断データを読み込んで再開する(読み込んだ中断データは消す)Suspend.load()

System (199)

font.* は System.font.setFamily(...)、messageWindow.* は System.messageWindow.setFont(...) のように書きます。変数(setVarInt など)は System が持つ整数・文字列の変数で、シナリオの setvar の変数とは別です。

メソッド引数説明呼び出し例
addFlowchartFlagname, valueフローチャートの印に足す(結果は 0〜9 に丸める)System.addFlowchartFlag(name, value)
addPluginDirectorypath検索パス追加System.addPluginDirectory(path)
addSystemFlagname, valueシステムフラグに足す(結果は 0〜9 に丸める)System.addSystemFlag(name, value)
addVarIntname, value整数変数に足すSystem.addVarInt(name, value)
assertcondition, message偽なら失敗にする(Debug 時はログにも出す)System.assert(condition, message)
beginAssetBatch—画像をまとめて GPU へ送る囲いを始める。囲いの中では待ちや文章表示を挟まず、素材の登録だけを書くSystem.beginAssetBatch()
captureGrab—今の画面を表に出さずに取り込んでおく(保存の窓を開く前に呼ぶと、操作ボタンの無い絵を残せる)System.captureGrab()
captureScreen[mode]画面を PNG で保存。引数なしは exe の隣の capture\capture_0001.png から空いている番号へ(書けないときはセーブフォルダの capture)。"ask" は保存先を選ぶ窓を出す(既定 PNG。BMP も選べる)。Android・ブラウザも PNG で、ブラウザはダウンロードとして渡す("ask" でも窓は出ない)System.captureScreen([mode])
checkFlowchartFlag(値のみ)name, op, valueフローチャートの印を比べる(op は "==" / "!=" / "<" / "<=" / ">" / ">="。1/0)System.checkFlowchartFlag(name, op, value)
checkSystemFlag(値のみ)name, op, valueシステムフラグを比べる(op は checkFlowchartFlag と同じ。1/0)System.checkSystemFlag(name, op, value)
clearAllClearFlags—クリアフラグを全部消すSystem.clearAllClearFlags()
clearPluginDirectories—検索パスクリアSystem.clearPluginDirectories()
clearVars—System の整数・文字列変数を全部消すSystem.clearVars()
concatVarStrname, value文字列変数の後ろへつなぐSystem.concatVarStr(name, value)
debugDump—システム状態ダンプ(Debug 時のみ)System.debugDump()
debugLogmessageDebug 時ログ出力System.debugLog(message)
divVarIntname, value整数変数を割るSystem.divVarInt(name, value)
dumpDialogImageLayoutkindConfirm.dumpImageLayout と同じSystem.dumpDialogImageLayout(kind)
editMessageonVar, nameVar, bodyVarメッセージの編集画面を出す。3 つの変数の今の値で始め、決定したときだけ書き戻すSystem.editMessage(onVar, nameVar, bodyVar)
endAssetBatch—beginAssetBatch の囲いを閉じて、まとめて送るSystem.endAssetBatch()
execcodeインラインコード実行System.exec(code)
executecommand外部プログラム起動("notepad.exe file.txt" のように実行ファイルと引数を空白区切り)System.execute(command)
exit[kind, fadeOutMs, holdMs]確認のうえ終了(kind 既定 menuExit。fadeOutMs が 0 より大きいと暗転してから閉じ、holdMs は暗転しきってから閉じるまでの間)System.exit([kind, fadeOutMs, holdMs])
exitAskYesNomessage[, caption, yesLabel, noLabel]はい/いいえの窓を出し、はいなら終了System.exitAskYesNo(message[, caption, yesLabel, noLabel])
fadeFromBlackfadeOutMs黒い幕を明ける(幕が出ていなければ何もしない)System.fadeFromBlack(fadeOutMs)
fadeFromColorfadeOutMs, r, g, b色の幕を明けるSystem.fadeFromColor(fadeOutMs, r, g, b)
fadeToBlackfadeInMs黒い幕を張って、fadeFromBlack / hideImage まで保つSystem.fadeToBlack(fadeInMs)
fadeToColorfadeInMs, r, g, b色の幕を張るSystem.fadeToColor(fadeInMs, r, g, b)
font.apply—書体設定をメッセージ窓へ反映System.font.apply()
font.getBold(値のみ)—太字か(1/0)System.font.getBold()
font.getCurrentFamilyIndex(値のみ)—今の書体が選べる一覧の何番目かSystem.font.getCurrentFamilyIndex()
font.getDropShadow(値のみ)—ドロップシャドウか(1/0)System.font.getDropShadow()
font.getFamily(値)—今の書体名System.font.getFamily()
font.getFamilyAt(値)index選べる書体の index 番目の名前System.font.getFamilyAt(index)
font.getFamilyCount(値)—選べる書体の数System.font.getFamilyCount()
font.getOutline(値のみ)—アウトラインか(1/0)System.font.getOutline()
font.getOutlineEmphasis(値のみ)—太いアウトラインか(1/0)System.font.getOutlineEmphasis()
font.getQuality(値のみ)—文字の描き方の値System.font.getQuality()
font.getStyleColor(値のみ)—影・アウトラインの色System.font.getStyleColor()
font.load—保存した書体設定を読むSystem.font.load()
font.loadEmbeddedpath組み込み書体を読み込むSystem.font.loadEmbedded(path)
font.prewarm[count]まだ読んでいない組み込み書体を count 本(既定 1)先に読む。手が空いたときに 1 本ずつ呼ぶSystem.font.prewarm([count])
font.refreshFamilies—選べる書体の一覧を作り直すSystem.font.refreshFamilies()
font.registerEmbeddedpath[, displayName]組み込み書体を登録System.font.registerEmbedded(path[, displayName])
font.save—書体設定を保存System.font.save()
font.setBoldon太字System.font.setBold(on)
font.setDropShadowonドロップシャドウSystem.font.setDropShadow(on)
font.setFamilynameフォントファミリSystem.font.setFamily(name)
font.setLicencefontDisplayName, licencePath書体のライセンス文の場所System.font.setLicence(fontDisplayName, licencePath)
font.setOutlineonアウトラインSystem.font.setOutline(on)
font.setOutlineEmphasison太いアウトラインSystem.font.setOutlineEmphasis(on)
font.setQualityquality文字の描き方(0〜5。5 = ClearType)System.font.setQuality(quality)
font.setStyleColorcolor影・アウトラインの色("#RRGGBB")System.font.setStyleColor(color)
font.showDialog—書体を選ぶ窓を出すSystem.font.showDialog()
getClearFlag(値のみ)nameクリアフラグ(1/0)System.getClearFlag(name)
getDataRoot(値)—データルート取得System.getDataRoot()
getDialogImageDirectory(値)—画像ダイアログのフォルダSystem.getDialogImageDirectory()
getDialogTextkind確認ダイアログの題・本文System.getDialogText(kind)
getDialogType(値)kind確認ダイアログの種類System.getDialogType(kind)
getEnv(値のみ)name環境変数を文字で返す(無ければ空。Android は launch.txt、ブラウザは ?名前=値)System.getEnv("LUMINA_LANG_TEST")
getExtension(値)type拡張子取得System.getExtension(type)
getFlowchartFlag(値のみ)nameフローチャートの印(未設定は 0)System.getFlowchartFlag(name)
getFolder(値)keyフォルダパス取得System.getFolder(key)
getLoadFadeIn(値)—setLoadFadeIn の値System.getLoadFadeIn()
getRunMode(値)—現在モード取得("Debug" / "Release")System.getRunMode()
getSavedVarInt(値)name[, default]保存済みの環境設定(config.*)の値。復元の前でも読める(PreInitialize.txt 用。手元の値は変えない)System.getSavedVarInt("config.language", 0)
getSystemFlag(値のみ)nameシステムフラグ(未設定は 0)System.getSystemFlag(name)
getVarInt(値)name整数変数(config.* は設定の実体から読む)System.getVarInt(name)
getVarStr(値)name文字列変数System.getVarStr(name)
hasSaveDataslot使えません(呼ぶと失敗する)。SaveSlot.hasState を使うSystem.hasSaveData(slot)
hideImage[fadeOutMs]showImage の画像を消すSystem.hideImage([fadeOutMs])
ifIniBoolsection, key, default, codeIf[, codeElse]INI bool 分岐System.ifIniBool(section, key, default, codeIf[, codeElse])
ifIniEnabledcodeIf[, codeElse]INI 有効時分岐System.ifIniEnabled(codeIf[, codeElse])
ifVarEqualsname, val, codeIf[, codeElse]変数一致分岐System.ifVarEquals(name, val, codeIf[, codeElse])
ifVarGreatername, value, codeIf[, codeElse]変数が大きいとき分岐System.ifVarGreater(name, value, codeIf[, codeElse])
ifVarGreaterOrEqualname, value, codeIf[, codeElse]変数が以上のとき分岐System.ifVarGreaterOrEqual(name, value, codeIf[, codeElse])
ifVarLessname, value, codeIf[, codeElse]変数が小さいとき分岐System.ifVarLess(name, value, codeIf[, codeElse])
ifVarLessOrEqualname, value, codeIf[, codeElse]変数が以下のとき分岐System.ifVarLessOrEqual(name, value, codeIf[, codeElse])
ifVarNotEqualsname, value, codeIf[, codeElse]変数が違うとき分岐System.ifVarNotEquals(name, value, codeIf[, codeElse])
ifVarStrEqualsname, value, codeIf[, codeElse]文字列変数が一致するとき分岐System.ifVarStrEquals(name, value, codeIf[, codeElse])
ifVarStrNotEqualsname, value, codeIf[, codeElse]文字列変数が違うとき分岐System.ifVarStrNotEquals(name, value, codeIf[, codeElse])
isDebugMode(値)—Debug かどうか(1/0)System.isDebugMode()
isSeen(値のみ)category, nameその絵を一度でも画面に出したか(1/0。フォルダと拡張子は落として比べる)System.isSeen("chara", "akari_smile")
jumpScenariopath[, label]別のシナリオへ切り替える。シナリオ変数は保つ。"ファイル *ラベル" の 1 引数でも書ける。シナリオ実行中に呼んでも安全(飛び先が見つからなければ失敗して今のシナリオのまま)System.jumpScenario(path[, label])
loadDataslot使えません(呼ぶと失敗する)。SaveSlot.loadState を使うSystem.loadData(slot)
loadPlugindllNameDLL ロードSystem.loadPlugin(dllName)
loadScenariopathシナリオを新しく始める。始める前にシナリオ変数(setvar の値)を消すSystem.loadScenario(path)
loadStartPosition—起動引数(--start-scenario= / --start-label=)で開始位置が渡されていれば、そのシナリオ(とラベル)から始める。無ければ何もしないSystem.loadStartPosition()
logmessageDebug 時ログ出力System.log(message)
messageWindow.addButtonactionId, x, y, normal, hover, pressed, disabled枠にボタンを置くSystem.messageWindow.addButton(actionId, x, y, normal, hover, pressed, disabled)
messageWindow.apply—設定を反映System.messageWindow.apply()
messageWindow.bindShowTexton本文の表示をこの枠へつなぐSystem.messageWindow.bindShowText(on)
messageWindow.buttonActionactionId組み込みのボタン動作(qsave / qload / auto / skip / hide / backlog など)を実行する(上部メニューなどから使う)System.messageWindow.buttonAction(actionId)
messageWindow.clear—本文を消すSystem.messageWindow.clear()
messageWindow.clearButtons—ボタンを全部消すSystem.messageWindow.clearButtons()
messageWindow.clearPreview—setPreview の見本を消すSystem.messageWindow.clearPreview()
messageWindow.fadeOpacitytargetOpacity, durationMs[, steps]下敷きの濃さを今の値からフェード(steps 既定 30)System.messageWindow.fadeOpacity(targetOpacity, durationMs[, steps])
messageWindow.getButtonsLocked(値)—ボタンの固定表示が入かSystem.messageWindow.getButtonsLocked()
messageWindow.getNameDisplayMode(値)—名前の出し方("text" / "separated" / "integrated")System.messageWindow.getNameDisplayMode()
messageWindow.getNameMode(値)—名前の出し方(0=文字 / 1=画像)System.messageWindow.getNameMode()
messageWindow.getTextSpeed(値)—文字送りの速さ(ms)System.messageWindow.getTextSpeed()
messageWindow.getWordWrap(値のみ)—単語折り返しが入か(1/0)System.messageWindow.getWordWrap()
messageWindow.invokeactionIdregister したハンドラを実行System.messageWindow.invoke(actionId)
messageWindow.loadNameAreaGuidepath名前欄の位置の目安になる絵System.messageWindow.loadNameAreaGuide(path)
messageWindow.loadNameAssetsbasePath名前画像のフォルダSystem.messageWindow.loadNameAssets(basePath)
messageWindow.registeractionId, codeボタンのハンドラを登録System.messageWindow.register(actionId, code)
messageWindow.setAdvanceIconpath[, frames, frameW, frameH, intervalMs]文字送りアイコン(横一列のスプライトシート。frameW / frameH が 0 ならシートを等分。intervalMs 既定 100)System.messageWindow.setAdvanceIcon(path[, frames, frameW, frameH, intervalMs])
messageWindow.setAdvanceIconEnabledon文字送りアイコンを出すかSystem.messageWindow.setAdvanceIconEnabled(on)
messageWindow.setAdvanceIconPosx, y文字送りアイコンの位置System.messageWindow.setAdvanceIconPos(x, y)
messageWindow.setAdvanceIconSizew, h文字送りアイコンの大きさSystem.messageWindow.setAdvanceIconSize(w, h)
messageWindow.setAssetsframePath, backgroundPath, textAreaPath枠の絵(枠・下敷き・本文欄)System.messageWindow.setAssets(framePath, backgroundPath, textAreaPath)
messageWindow.setBackgroundColorcolor下敷きの色("#RRGGBB" か "#AARRGGBB")System.messageWindow.setBackgroundColor(color)
messageWindow.setBackgroundOpacityopacity下敷きの濃さ(0.0〜1.0)System.messageWindow.setBackgroundOpacity(opacity)
messageWindow.setButtonEnabledactionId, enabledボタンの有効/無効(無効は灰色で残る)System.messageWindow.setButtonEnabled(actionId, enabled)
messageWindow.setButtonsAnimationdurationMs, slideDistance, proximityMarginボタンの出入りの動きSystem.messageWindow.setButtonsAnimation(durationMs, slideDistance, proximityMargin)
messageWindow.setButtonsLockedlockedボタンを固定表示にする(1/0。押せなくするのではない)System.messageWindow.setButtonsLocked(locked)
messageWindow.setButtonTooltipactionId, tooltipPathボタンの案内の絵System.messageWindow.setButtonTooltip(actionId, tooltipPath)
messageWindow.setButtonVisibleactionId, visibleボタンを描くか(非表示は当たり判定も無くなる。有効/無効とは別)System.messageWindow.setButtonVisible(actionId, visible)
messageWindow.setCaptureRangeminY, maxY本文として拾う縦の範囲System.messageWindow.setCaptureRange(minY, maxY)
messageWindow.setFontfamily, size[, bold, color, shadow, shadowColor, shadowX, shadowY]本文の書体(2〜8 引数)System.messageWindow.setFont(family, size[, bold, color, shadow, shadowColor, shadowX, shadowY])
messageWindow.setHideWhenEmptyon本文が空のとき枠を隠すSystem.messageWindow.setHideWhenEmpty(on)
messageWindow.setNamename名前欄に出す名前(空で名前欄を出さない)System.messageWindow.setName(name)
messageWindow.setNameDisplayModemode名前の出し方("text" / "separated" / "integrated")System.messageWindow.setNameDisplayMode(mode)
messageWindow.setNameImagePositionx, y名前画像の位置System.messageWindow.setNameImagePosition(x, y)
messageWindow.setNameModemode名前の出し方(0=文字 / 1=画像)System.messageWindow.setNameMode(mode)
messageWindow.setNameTextAreax, y, w, h名前の文字の範囲System.messageWindow.setNameTextArea(x, y, w, h)
messageWindow.setPositionx, y枠の位置System.messageWindow.setPosition(x, y)
messageWindow.setPreviewx, y, w, h, text[, scene]本物と同じ枠・書体・濃さ・文字送りの見本を出す(環境設定用。scene は後ろに敷く絵。画面を組み直すたびに呼ぶ)System.messageWindow.setPreview(x, y, w, h, text[, scene])
messageWindow.setTexttext本文を出すSystem.messageWindow.setText(text)
messageWindow.setTextAreax, y, w, h本文の範囲System.messageWindow.setTextArea(x, y, w, h)
messageWindow.setTextSpeedms文字送りの速さSystem.messageWindow.setTextSpeed(ms)
messageWindow.setTooltipAnimationdurationMs, slideDistance, offsetY案内の出入りの動きSystem.messageWindow.setTooltipAnimation(durationMs, slideDistance, offsetY)
messageWindow.setVisibleon枠を出す/隠すSystem.messageWindow.setVisible(on)
messageWindow.setWordWrap[on]本文を単語の途中で折り返さない(英語など。既定 0=1 文字ずつ。引数なしで入)System.messageWindow.setWordWrap(1)
modVarIntname, value整数変数の余りSystem.modVarInt(name, value)
mulVarIntname, value整数変数に掛けるSystem.mulVarInt(name, value)
notifymessage画面の右上に短い知らせを出す(Windows・Android・ブラウザ)。文の長さに合わせて 2.5〜7 秒で消える。続けて呼ぶと順に出る(待たせるのは 5 件まで)。"\n" で改行して 3 行まで、長い行は「…」で切る。ゲームは止めないSystem.notify(message)
randomIntname, min, maxmin〜max の整数の乱数を整数変数へ入れるSystem.randomInt(name, min, max)
randomSeedseed乱数の種(Math.random と Math.mtRandom の両方)System.randomSeed(seed)
returnToTitle[kind, fadeOutMs]確認のうえタイトルへ戻る(kind 既定 titleExit。オート・スキップ・シーン送りは止める)System.returnToTitle([kind, fadeOutMs])
saveDataslot使えません(呼ぶと失敗する)。SaveSlot.saveState を使うSystem.saveData(slot)
setAllowedPlugins[...]読んでよいプラグインの一覧System.setAllowedPlugins([...])
setClearFlagname, valueクリアフラグ(0 以外で立つ)。systemdata に残るSystem.setClearFlag(name, value)
setCloseFade[ms]右上の×で閉じるときの暗転時間(既定 800)System.setCloseFade([ms])
setDataRootpathデータルートSystem.setDataRoot(path)
setDebugLogEnabledonログ有効/無効System.setDebugLogEnabled(on)
setDialogImageAssetskind, background, yesNormal, yesHover, yesPressed, yesDisabled, noNormal, noHover, noPressed, noDisabledConfirm.setImageAssets と同じSystem.setDialogImageAssets(kind, background, yesNormal, yesHover, yesPressed, yesDisabled, noNormal, noHover, noPressed, noDisabled)
setDialogImageDirectorydirConfirm.setImageDirectory と同じSystem.setDialogImageDirectory(dir)
setDialogImageLayoutkind, yesX, yesY, noX, noYConfirm.setImageLayout と同じSystem.setDialogImageLayout(kind, yesX, yesY, noX, noY)
setDialogImageMessagekind, messagePathConfirm.setImageMessage と同じSystem.setDialogImageMessage(kind, messagePath)
setDialogImagePanelkind, panelPathConfirm.setImagePanel と同じSystem.setDialogImagePanel(kind, panelPath)
setDialogTextkind[, caption, prompt]確認ダイアログの題・本文System.setDialogText(kind[, caption, prompt])
setDialogTypekind, type確認ダイアログの種類System.setDialogType(kind, type)
setExitDialogenabled終了確認ダイアログを出すかSystem.setExitDialog(enabled)
setExtensiontype, ext拡張子設定(systemScript / scenarioScript / image など)System.setExtension("image", "lgc")
setFadeEasingfadeInMode, fadeOutMode幕のフェードの効き(0=直線 / 1=減速 / 2=加速 / 3=両端ゆるやか)System.setFadeEasing(fadeInMode, fadeOutMode)
setFlowchartFlagname, valueフローチャートの印(0〜9 に丸める。0 で下ろす)。systemdata に残るSystem.setFlowchartFlag(name, value)
setFolderkey, pathフォルダマッピングSystem.setFolder(key, path)
setIniAutoCreateonINI 自動生成System.setIniAutoCreate(on)
setIniBoolsection, key, valueINI 値書き込みSystem.setIniBool(section, key, value)
setIniEnabledonINI 読み書き有効化System.setIniEnabled(on)
setLoadFade[fadeOutMs, holdMs, fadeInMs]ロードの演出(暗転・待ち・明ける。既定 300 / 200 / 400。明ける時間 0 で演出なし)System.setLoadFade([fadeOutMs, holdMs, fadeInMs])
setLoadFadeIn[ms]ロードで画面を戻した直後のフェードイン(0 で無効)System.setLoadFadeIn([ms])
setMessageEditStylestyleeditMessage の見た目("image" = 絵で描く・専用素材が要る / "dialog" = OS 標準の窓・既定)System.setMessageEditStyle(style)
setRunModemode実行モード設定("Debug" / "Release")System.setRunMode(mode)
setSaveDataIDidsetSaveDataId と同じSystem.setSaveDataID(id)
setSaveDataIdid製品識別子System.setSaveDataId(id)
setSaveDataModemodeセーブの書き方("" = 平文 / "c" / "z")System.setSaveDataMode(mode)
setSaveFoldernameセーブフォルダの名前System.setSaveFolder(name)
setSaveFolderNamenamesetSaveFolder と同じSystem.setSaveFolderName(name)
setSaveProductbrand[, game]製品名(ブランド名・作品名。片方だけでもよい)System.setSaveProduct(brand[, game])
setSaveRootkindセーブ先("InstallPath"(exe の隣)/ "MyDocuments" / "MyGamesDocuments" / "AppData")System.setSaveRoot(kind)
setSceneVeilImagejumpImage, backImageシーン送り/戻しの幕に敷く絵(呼ばなければ黒)System.setSceneVeilImage(jumpImage, backImage)
setSceneVeilTextjumpText, backTextシーン送り/戻しの幕に出す文言(呼ばなければ出さない。空で下ろす)System.setSceneVeilText(jumpText, backText)
setScriptPasswordpw.lsf 復号パスワードSystem.setScriptPassword(pw)
setSplashDelaymsスプラッシュ遅延System.setSplashDelay(ms)
setSplashFadefadeInMs, fadeOutMsスプラッシュフェードSystem.setSplashFade(fadeInMs, fadeOutMs)
setSplashHoldmsスプラッシュ保持System.setSplashHold(ms)
setStartupDialogenabled起動ダイアログSystem.setStartupDialog(enabled)
setSystemFlagname, valueシステムフラグ(0〜9 に丸める。0 で下ろす)。systemdata に残るSystem.setSystemFlag(name, value)
setVarIntname, value整数変数System.setVarInt(name, value)
setVarStrname, value文字列変数System.setVarStr(name, value)
setVersiontextバージョン表示System.setVersion(text)
showAbout—簡易 About 窓System.showAbout()
showDialog(値)type[, options]窓を直接出す(options 既定 "exit")。LUMINA Script では、はいなら 1 を返すSystem.showDialog(type[, options])
showImagepath[, x, y]画像表示System.showImage(path[, x, y])
showLicenseEmbeddedwindowTitle, tab1Title, tab1Text, tab2Title, tab2Textライセンスの窓(文を直接渡す)System.showLicenseEmbedded(windowTitle, tab1Title, tab1Text, tab2Title, tab2Text)
showLicenseFromFilewindowTitle, tab1Title, tab1Path, tab2Title, tab2Pathライセンスの窓(ファイルから読む)System.showLicenseFromFile(windowTitle, tab1Title, tab1Path, tab2Title, tab2Path)
showTexttext[, x, y]テキスト表示System.showText(text[, x, y])
showVersionInfo[appTitle, appVersion, appCopyright, productId, systemName, systemVersion, systemCopyright]版の情報の窓(引数は 0 か 7)System.showVersionInfo([appTitle, appVersion, appCopyright, productId, systemName, systemVersion, systemCopyright])
subVarIntname, value整数変数から引くSystem.subVarInt(name, value)
switchmode, code0, code1, ...数値直接分岐System.switch(mode, code0, code1, ...)
switchArgindex, default, code0, ...コマンドライン引数で分岐System.switchArg(index, default, code0, ...)
switchEnvvar, default, code0, code1, ...環境変数で分岐System.switchEnv(var, default, code0, code1, ...)
switchInisection, key, default, ...INI 値で分岐System.switchIni(section, key, default, ...)
switchVarname, code0, code1, ...整数変数で分岐System.switchVar(name, code0, code1, ...)
timelinedefinition時系列ステップ実行System.timeline(definition)
waitmsミリ秒待機(メッセージポンプ)System.wait(ms)
warmMessageWindowImages[folders]メッセージ枠の絵を裏で先に読んでおく(タイトルが出そろってから呼ぶ。2 度目以降は何もしない。カンマ区切りでフォルダを足せる)System.warmMessageWindowImages([folders])

SystemInfo (1)

メソッド引数説明呼び出し例
show—システム情報の窓を出すSystemInfo.show()

SystemMenu (8)

メソッド引数説明呼び出し例
addItemtitle, actionId項目を足すSystemMenu.addItem(title, actionId)
addSeparator—区切り線SystemMenu.addSeparator()
apply—反映SystemMenu.apply()
clear—項目を全部消すSystemMenu.clear()
enableMenuBaronメニューバーの項目を出すかSystemMenu.enableMenuBar(on)
enableSystemInfoonシステム情報の項目を出すかSystemMenu.enableSystemInfo(on)
registeractionId, code項目のハンドラを登録SystemMenu.register(actionId, code)
removeactionId項目を消すSystemMenu.remove(actionId)

TextInput (1)

メソッド引数説明呼び出し例
show(値)bgPath, x, y[, w, h, initial, maxLen]文字入力の枠を出し、確定した文字列を返す(取消は空文字。w, h 既定 640, 120、maxLen 既定 64)var s = TextInput.show("", 320, 300, 640, 120, "", 16)

TextureFilter (1)

メソッド引数説明呼び出し例
set[filter]拡大縮小の補間(0=Point / 1=Linear(既定) / 2=Anisotropic)TextureFilter.set([filter])

Timer (7)

メソッド引数説明呼び出し例
elapsed(値)namegetElapsed と同じTimer.elapsed(name)
getElapsed(値)name経過時間(ms)Timer.getElapsed(name)
ifElapsedGreatertimerName, thresholdMs, codeIf[, codeElse]経過時間で分岐Timer.ifElapsedGreater(timerName, thresholdMs, codeIf[, codeElse])
resetnamestop と同じ(そのタイマーを消す)Timer.reset(name)
startnameタイマーを始めるTimer.start(name)
stopnameそのタイマーを消すTimer.stop(name)
storeElapsedtimerName, varName経過時間(ms)を System の整数変数へ入れるTimer.storeElapsed(timerName, varName)

Title (60)

タイトル画面と、同じ仕組みで組むシステム画面(環境設定・セーブ画面など)の API です。座標は設計座標(1280×720)。色は "#AARRGGBB" / "#RRGGBB" か整数で書けます。

メソッド引数説明呼び出し例
addButtonactionId, x, y, normal, hover, pressed, disabled[, w, h]ボタンを置く。7 引数は絵の実寸、9 引数は大きさを指定Title.addButton(actionId, x, y, normal, hover, pressed, disabled[, w, h])
addDragFolloweractionId, elementId掴んだときに一緒に運ぶ要素Title.addDragFollower(actionId, elementId)
addDropTargetid, x, y, w, h落とし先の枠を足すTitle.addDropTarget(id, x, y, w, h)
addImageid, path, x, y, w, h押せない飾りの絵を置くTitle.addImage(id, path, x, y, w, h)
addLabelid, x, y, w, h, text[, fontSize, color, bold, align]文字ラベルを置く(同じ id は作り直し)。align は "left" / "center" / "right" か 0 / 1 / 2(枠の中での寄せ方)Title.addLabel(id, x, y, w, h, text[, fontSize, color, bold, align])
addSpriteid, textureId, x, y, w, h作ったテクスチャ(サムネイルなど)をそのまま置くTitle.addSprite(id, textureId, x, y, w, h)
beginCoverTransition—今の画面を写して残し、次の show で新しい画面を上に重ねてフェードインするTitle.beginCoverTransition()
beginCoverTransitionBackgroundOnly—beginCoverTransition の背景だけ版Title.beginCoverTransitionBackgroundOnly()
beginRebuild—画面の組み立ての始まりの印。show まで途中の画面を描かない(下ろし忘れても 400ms で解除)Title.beginRebuild()
clear—全部消す(登録したハンドラも消す)Title.clear()
clearButtonDecideVoices—ボタンごとの決定音声を全部外すTitle.clearButtonDecideVoices()
clearButtons—ボタンだけ消す(背景と表示状態は残す)Title.clearButtons()
clearButtonsExceptPrefixesprefixesPipe接頭辞("|" 区切り)に合わないボタンを消すTitle.clearButtonsExceptPrefixes(prefixesPipe)
clearButtonsWithPrefixprefix接頭辞に合うボタンを消すTitle.clearButtonsWithPrefix(prefix)
clearDropTargets—落とし先の枠を全部消すTitle.clearDropTargets()
clearLabels—ラベルを全部消すTitle.clearLabels()
clearLayout—setLayout を外すTitle.clearLayout()
clearSprites—addSprite / addImage で置いた物を消すTitle.clearSprites()
getHoveredButton(値のみ)—今カーソルが乗っているボタンの識別子(無ければ空)Title.getHoveredButton()
getLastClickFracX(値のみ)—直前に押した位置がボタンの中で横のどこか(0.0〜1.0)Title.getLastClickFracX()
getLastClickFracY(値のみ)—同じく縦(0.0〜1.0)。スクロールの溝を押したときに使うTitle.getLastClickFracY()
getLastWaitReason(値のみ)—直前の waitUntilHidden が終わった理由(0=閉じた / 1=ボタン操作などで打ち切り / 2=時間切れ)Title.getLastWaitReason()
hide—隠すTitle.hide()
isButtonEnabled(値のみ)actionIdボタンが有効か(1/0)Title.isButtonEnabled(actionId)
isVisible(値)—出ているか(1/0)Title.isVisible()
preloadImagesfolderフォルダの絵をその場で先読みするTitle.preloadImages(folder)
preloadImagesInBackgroundfolderフォルダの絵を画面を出したあと少しずつ先読みする(その場では数えるだけ)Title.preloadImagesInBackground(folder)
registeractionId, codeボタンのハンドラを登録Title.register(actionId, code)
removeImageidaddImage で置いた飾りを 1 つ取り除くTitle.removeImage(id)
setBackgroundpath背景画像Title.setBackground(path)
setButtonAnimationdurationMs, staggerMs, offsetXボタンのスライドイン(1 個の時間・ずらし・距離)Title.setButtonAnimation(durationMs, staggerMs, offsetX)
setButtonDecideVoiceactionId[, file]そのボタンだけ決定音声を変える(空ならそのボタンは鳴らさない)Title.setButtonDecideVoice(actionId[, file])
setButtonEnabledactionId, enabledボタン有効化Title.setButtonEnabled(actionId, enabled)
setButtonHintactionId[, text]ボタンに乗っている間だけ出す案内(空で外す)Title.setButtonHint(actionId[, text])
setButtonImagesid, normal[, hover, pressed, disabled]押した瞬間にボタンの絵を差し替えるTitle.setButtonImages(id, normal[, hover, pressed, disabled])
setButtonsEnabledExceptPrefixesprefixesPipe, enabled接頭辞に合わないボタンを消さずに有効/無効にするTitle.setButtonsEnabledExceptPrefixes(prefixesPipe, enabled)
setCharaVisiblePercentlayer, percentCharacter.setVisiblePercent と同じ(立ち絵の映す割合)Title.setCharaVisiblePercent(layer, percent)
setCoversScene[on]表示中はシナリオの背景・立ち絵を描かない(Windows では何もしない。Windows 以外で使う)Title.setCoversScene([on])
setDecideVoicefile決定時に鳴らすシステム音声(data5/sysvoice の名前。空なら鳴らさない)Title.setDecideVoice(file)
setDragContextVarvarName掴んだ時点で控える変数(ページ番号など)Title.setDragContextVar(varName)
setDragFreeMoveactionId[, enabled]落とし先を使わず、離した場所へ置く(drag.source / drag.x / drag.y を入れてハンドラを呼ぶ)Title.setDragFreeMove(actionId[, enabled])
setDraggableactionId[, enabled]ボタンを掴んで運べるようにするTitle.setDraggable(actionId[, enabled])
setDragKeepsSourcekeep運んでも元を残す(コピーのような操作)Title.setDragKeepsSource(keep)
setFadefadeInMs, fadeOutMs出す/隠すときのフェードTitle.setFade(fadeInMs, fadeOutMs)
setFadeEasingfadeInMode, fadeOutModeフェードの効き(0=直線 / 1=減速 / 2=加速 / 3=両端ゆるやか)Title.setFadeEasing(fadeInMode, fadeOutMode)
setFrontLayerid, frontボタン/ラベルを前面に置く(他の文字より後に描く)Title.setFrontLayer(id, front)
setHintStylefontSize, textColor, plateColor, offsetYsetButtonHint の案内の見た目Title.setHintStyle(fontSize, textColor, plateColor, offsetY)
setLabelFontid, familyラベルの書体(空で画面共通の書体)Title.setLabelFont(id, family)
setLabelTextid, textラベルの文字を差し替えるTitle.setLabelText(id, text)
setLayoutx, y, w, h画面の配置Title.setLayout(x, y, w, h)
setOverlaypath重ねる画像Title.setOverlay(path)
setPluginCanvases[on]mrumotion の絵を、この画面の背景とボタンの間に載せる(位置は Motion.setPosition で決める)Title.setPluginCanvases([on])
setScrollDragbuttonId, actionId[, varName, maxIndex]溝のボタンを掴んで動かしている間ずっと actionId を呼ぶ(位置は getLastClickFracY)。varName を渡すとハンドラを通さずその変数へ番号(0〜maxIndex)を直接入れる。空の buttonId で解除Title.setScrollDrag(buttonId, actionId[, varName, maxIndex])
setSegBarprefix, value, segBase[, count]目盛りの絵を押した瞬間に塗り替える(段数 既定 11)Title.setSegBar(prefix, value, segBase[, count])
setSoundshoverSE, clickSE, cancelSEボタン SETitle.setSounds(hoverSE, clickSE, cancelSE)
setWheelActionupAction, downAction[, varName, step, maxIndex]ホイールで呼ぶ処理。varName を渡すとその変数を step ずつ(既定 3)0〜maxIndex の範囲で増減する。空で解除Title.setWheelAction(upAction, downAction[, varName, step, maxIndex])
show—出す(beginRebuild / clearButtons で始まった組み立てはここで終わる)Title.show()
skipWait—waitUntilHidden の待ちを打ち切るTitle.skipWait()
waitUntilHidden[timeoutMs]画面が閉じるまで待つ(ボタンのハンドラはこの間に動く)Title.waitUntilHidden([timeoutMs])
wasClosedExternally(値)—「タイトルへ戻る」などで外から閉じられたか(1/0。読むと戻る)Title.wasClosedExternally()

Transition (8)

メソッド引数説明呼び出し例
beginSnapshot—今の画面を写して一番上に置く(このあと背景や立ち絵を変えても画面は止まって見える)Transition.beginSnapshot()
cancelSnapshot—写しを捨てるTransition.cancelSnapshot()
crossfadebgPath, durationMs背景をクロスフェードで切り替えるTransition.crossfade(bgPath, durationMs)
fadeThroughbgPath, durationMs[, r, g, b]色を挟んで切り替える(既定 黒)Transition.fadeThrough(bgPath, durationMs[, r, g, b])
isSnapshotHeld(値)—写しを持っているか(1/0)Transition.isSnapshotHeld()
rulebgPath, durationMs, ruleName[, vague]ルール画像で背景を切り替える(完了まで待つ。立ち絵は動かさない。vague 既定 64)Transition.rule(bgPath, durationMs, ruleName[, vague])
runSnapshotruleName, durationMs[, vague]写しを消していき新しい場面を出す(ruleName が空か "crossfade" なら透明度だけで消す)Transition.runSnapshot(ruleName, durationMs[, vague])
wipebgPath, durationMs[, dir]ワイプで切り替える(dir 0=左 / 1=右 / 2=上 / 3=下)Transition.wipe(bgPath, durationMs[, dir])

VoiceCharacter (4)

メソッド引数説明呼び出し例
getVolume(値)charaId話者の音量VoiceCharacter.getVolume(charaId)
isMuted(値)charaId話者を消音しているか(1/0)VoiceCharacter.isMuted(charaId)
setMutedcharaId, muted話者を消音するVoiceCharacter.setMuted(charaId, muted)
setVolumecharaId, vol話者の音量(0〜100)VoiceCharacter.setVolume(charaId, vol)

Window (27)

メソッド引数説明呼び出し例
applyFPS—FPS 適用Window.applyFPS()
applyScreenModemode画面モードを適用("FALSE"=ウィンドウ / "DirectX12" / "Win32")Window.applyScreenMode(mode)
clear—画面の表示レイヤー(背景・立ち絵・イベント CG・スプライト・表示中の画像)を全部消すWindow.clear()
getContentAspect(値のみ)—4:3 画面モード(0=ワイド / 1=スクエア / 2=自動)Window.getContentAspect()
getFPS(値のみ)—目標フレームレートWindow.getFPS()
getScaleMode(値のみ)—拡大方法(0=内接 / 1=外接 / 2=拡大しない / 3=中間)Window.getScaleMode()
getScalingFilter(値のみ)—拡大時のスムージング(0=Lanczos / 1=Cubic / 2=SharpLinear / 3=Linear)Window.getScalingFilter()
isVirtualFullscreen(値)—仮想フルスクリーン中かWindow.isVirtualFullscreen()
resetCursor—カーソルリセットWindow.resetCursor()
setAppIdidタスクバー AppUserModelIDWindow.setAppId(id)
setAspectLockmodeアスペクトロックWindow.setAspectLock(mode)
setContentAspectmode4:3 画面モード(0=ワイド / 1=4:3 / 2=自動)Window.setContentAspect(mode)
setCursor[name]カーソル("arrow" / "hand" / "wait" / "ibeam" / "cross" / "help" / "no" か .cur / .ani のファイル。空で arrow)Window.setCursor([name])
setFPSnフレームレートWindow.setFPS(n)
setIconpath または dir, fileアイコン(読めなければ埋め込みのまま)Window.setIcon(path)
setMarginWallpaperpath余白(4:3 で増やした分・画面比が合わない帯)に敷く絵。空で黒Window.setMarginWallpaper(path)
setMultiCoreenabled, coreCountマルチコアの使い方(2 引数が要る)Window.setMultiCore(enabled, coreCount)
setResizableboolリサイズ可否Window.setResizable(bool)
setScaleModemode拡大方法(0=内接 / 1=外接 / 2=拡大しない / 3=中間)Window.setScaleMode(mode)
setScalingFiltertype[, cubicStrength]拡大時のスムージング(0=Lanczos / 1=Cubic / 2=SharpLinear / 3=Linear)Window.setScalingFilter(type[, cubicStrength])
setSingleInstancebool多重起動防止Window.setSingleInstance(bool)
setSingleInstanceKeykey多重起動キーWindow.setSingleInstanceKey(key)
setSizew, h窓の中身の大きさ(ブラウザ版はページいっぱいに表示し、ページの上の端に出るメニューの「ウィンドウ表示時サイズ」から選んだときだけその大きさになる。ブラウザ版だけの「ページに合わせる」で戻る)Window.setSize(w, h)
setTitletitleウィンドウタイトルWindow.setTitle(title)
setTopMostbool最前面Window.setTopMost(bool)
setVirtualFullscreenbool仮想フルスクリーンWindow.setVirtualFullscreen(bool)
toggleVirtualFullscreen—フルスクリーン切替Window.toggleVirtualFullscreen()

組み込み関数 (7)

LUMINA Script でオブジェクト名を付けずに呼べる関数です。どれも値を返します。ここに無い名前を付けずに呼ぶと Common の命令として実行されます(Wait(500) など)。typeof x も使えます。console は Debug の別名です。

関数引数説明呼び出し例
Booleanx真偽値にするBoolean(x)
isFinitex有限の数か(true/false)isFinite(x)
isNaNxNaN か(true/false)isNaN(x)
Numberx数にするNumber("12")
parseFloats文字列を数にする(読めなければ NaN)parseFloat("3.5")
parseInts[, radix]文字列を整数にする("0x" で始まれば 16 進。読めなければ NaN)parseInt("42")
Stringx文字列にする(整数は小数点なし。true / false / null も文字にする)String(12)

使えない旧グローバル関数 (29)

この表の関数は現在使えません。システムスクリプトの実行には使われていない旧い評価器にだけ登録されている関数で、呼んでも「知らない命令」として失敗し、何も起きません(値も返りません)。右の列の命令を使ってください。以前この一覧にあった ShowImage / HideImage / PlayMovie / StopMovie は Common の命令として今も使えるので、そちらへ移しました。

関数元の役目代わりに使う代わりの例
AddCounterカウンタに足すSystem.addVarIntSystem.addVarInt("play_count", 1)
AddFlowchartFlagフローチャートの印に足すSystem.addFlowchartFlagSystem.addFlowchartFlag("ch02", 1)
AddScenarioFlagシナリオフラグに足すシナリオの addvar(システムスクリプトからは読み書きできない)addvar love 2
AddSystemFlagシステムフラグに足すSystem.addSystemFlagSystem.addSystemFlag("route_a", 1)
CheckFlowchartFlagフローチャートの印を比べるSystem.checkFlowchartFlag(値のみ)System.checkFlowchartFlag("ch02", ">=", 1)
CheckScenarioFlagシナリオフラグを比べるシナリオの #if#if "love >= 5"
CheckSystemFlagシステムフラグを比べるSystem.checkSystemFlag(値のみ)System.checkSystemFlag("route_a", ">=", 2)
ClearAllClearFlagsクリアフラグを全部消すSystem.clearAllClearFlagsSystem.clearAllClearFlags()
GetClearFlagクリアフラグを読むSystem.getClearFlag(値のみ)System.getClearFlag("game_cleared")
GetCounterカウンタを読むSystem.getVarIntSystem.getVarInt("play_count")
GetFlagフラグを読むSystem.getVarIntSystem.getVarInt("opened")
GetFlowchartFlagフローチャートの印を読むSystem.getFlowchartFlag(値のみ)System.getFlowchartFlag("ch02")
GetScenarioFlagシナリオフラグを読むシナリオ変数(setvar の値。システムスクリプトからは読めない)#if "love >= 5"
GetSystemFlagシステムフラグを読むSystem.getSystemFlag(値のみ)System.getSystemFlag("route_a")
IsMoviePlaying動画が再生中かMovie.isPlayingMovie.isPlaying()
PlayBGMBGM を鳴らすSound.playBgm / bgm_playSound.playBgm("title")
PlaySESE を鳴らすSound.playSe / se_playSound.playSe("click")
PlayVoiceボイスを鳴らすSound.playVoiceSound.playVoice("vo01_0001")
printログへ出すDebug.log / console.logconsole.log("value=" + v)
random乱数Math.randomMath.random(1, 6)
SetClearFlagクリアフラグを立てるSystem.setClearFlagSystem.setClearFlag("game_cleared", 1)
SetCounterカウンタを入れるSystem.setVarIntSystem.setVarInt("play_count", 0)
SetFlagフラグを入れるSystem.setVarIntSystem.setVarInt("opened", 1)
SetFlowchartFlagフローチャートの印を入れるSystem.setFlowchartFlagSystem.setFlowchartFlag("ch02", 1)
SetScenarioFlagシナリオフラグを入れるシナリオの setvarsetvar love 5
SetSystemFlagシステムフラグを入れるSystem.setSystemFlagSystem.setSystemFlag("route_a", 1)
SetWindowSize窓の大きさWindow.setSizeWindow.setSize(1280, 720)
SetWindowTitle窓のタイトルWindow.setTitleWindow.setTitle("My Game")
StopBGMBGM を止めるSound.stopBgm / bgm_stopSound.stopBgm()