一枚絵(CG)・背景

ページ概要

  • 対象ファイル: character.json, events/*.json
  • 役割: 背景は background/custom_background_path、CGは cg_gallery に登録したIDを cg で呼び出して表示します。
  • どこで使われるか: イベント実行時(image/dialogue
  • 最小構成: 背景ID指定(このページの「システム背景(場所ID)」)
  • よくあるミス: cg_gallery を配列で書く、CG ID未定義、パスがMOD外を指す

背景の種類

  • システム背景: 場所ID(例: school, cafe)を指定すると、季節・時間帯に応じた背景が自動表示されます
  • MOD背景: 画像ファイルのパスを指定して、独自背景を表示します
  • 一枚絵(CG): cg_gallery で定義したIDを指定して表示します

システム背景(場所ID)を表示

{
  "scene_id": "s01",
  "type": "image",
  "background": "cafe"
}

background には特別なIDとして my_room も指定できます(主人公の性別に応じて部屋背景に置き換えられます)。

MOD背景(画像ファイル)を表示

MOD内に背景画像を置き、custom_background_path で指定します。

my_mod/
└── backgrounds/
    └── festival_night.png
{
  "scene_id": "s10",
  "type": "image",
  "custom_background_path": "backgrounds/festival_night.png"
}

注意

  • パスはMODフォルダ内からの相対パスで指定してください
  • 会話シーン(dialogue)でも background を指定すると背景切り替えできます

CGを定義(character.json の cg_gallery)

CGはキャラクター定義側でメタデータ登録し、イベント側でIDを呼び出す方式です。

{
  "cg_gallery": {
    "confession_rooftop": {
      "path": "cg/confession_rooftop.png",
      "title_ja": "屋上の告白",
      "title_en": "Confession on the Rooftop"
    }
  }
}

path は季節対応(マップ)も可能です。

{
  "cg_gallery": {
    "ending_cg": {
      "path": { "spring": "cg/ending_spring.png", "default": "cg/ending.png" },
      "title_ja": "エンディング",
      "title_en": "Ending"
    }
  }
}

CGを表示/解除(イベント側)

表示

{
  "scene_id": "s20",
  "type": "image",
  "cg": "confession_rooftop"
}

解除(通常背景に戻す)

{
  "scene_id": "s21",
  "type": "image",
  "cg": false
}

関連