diff --git a/docs/assets/4-inspector_preview-1.webm b/docs/assets/4-inspector_preview-1.webm index 0374d86..cab113c 100644 Binary files a/docs/assets/4-inspector_preview-1.webm and b/docs/assets/4-inspector_preview-1.webm differ diff --git a/docs/assets/4-inspector_preview-1.webp b/docs/assets/4-inspector_preview-1.webp index 45579d4..77889cc 100644 Binary files a/docs/assets/4-inspector_preview-1.webp and b/docs/assets/4-inspector_preview-1.webp differ diff --git a/docs/assets/4-inspector_preview-2.webm b/docs/assets/4-inspector_preview-2.webm index cab113c..0374d86 100644 Binary files a/docs/assets/4-inspector_preview-2.webm and b/docs/assets/4-inspector_preview-2.webm differ diff --git a/docs/assets/4-inspector_preview-2.webp b/docs/assets/4-inspector_preview-2.webp index 77889cc..45579d4 100644 Binary files a/docs/assets/4-inspector_preview-2.webp and b/docs/assets/4-inspector_preview-2.webp differ diff --git a/docs/en/api/player.md b/docs/en/api/player.md index 968b0ce..45c8b0a 100644 --- a/docs/en/api/player.md +++ b/docs/en/api/player.md @@ -99,7 +99,7 @@ The information configured on the timeline audio keyframe is delivered as a `Dic The `frame` property is animatable, so an `AnimationPlayer` can scrub a SpriteStudio animation in lockstep with its own timeline (and any other tracks on it — audio, calls, other nodes). -1. Assign `SSAB Resource` and pick an `Animation` on the `SpriteStudioPlayer2D` as usual. +1. Assign the `Ssab` resource and pick an `Animation` on the `SpriteStudioPlayer2D` as usual. 2. In the `AnimationPlayer`, add a **Property Track** targeting the node's `frame` property. 3. Keyframe `frame` over time (e.g. `0` → the last frame across the desired duration). `frame` is a float, so values interpolate. 4. Play the `AnimationPlayer`. diff --git a/docs/en/workflow/animation_player.md b/docs/en/workflow/animation_player.md index f29bc87..c6f0d3c 100644 --- a/docs/en/workflow/animation_player.md +++ b/docs/en/workflow/animation_player.md @@ -24,7 +24,7 @@ To control SSPlayer with an `AnimationPlayer`, you must first convert all animat Here is how to apply the generated library to your scene. 1. **Prepare the Node** - Place a `SpriteStudioPlayer2D` node in your scene and assign the target `.ssab` file to its `SSAB Resource` property. + Place a `SpriteStudioPlayer2D` node in your scene and assign the target `.ssab` file to its `Ssab` property. 2. **Add an AnimationPlayer** Add an `AnimationPlayer` node to the scene. 3. **Specify the Target (Important!)** diff --git a/docs/en/workflow/usage_asset_pipeline.md b/docs/en/workflow/usage_asset_pipeline.md index 19a9765..83e4188 100644 --- a/docs/en/workflow/usage_asset_pipeline.md +++ b/docs/en/workflow/usage_asset_pipeline.md @@ -31,8 +31,7 @@ Drag and drop the generated `.ssab` file into the 2D viewport to place a `Sprite When working in Godot and feeling the need to tweak an animation, you don't have to launch SpriteStudio separately and search for the project. 1. Select the **`SpriteStudioPlayer2D` node** playing the animation in the Godot editor. -2. Click to expand the **`SSAB Resource` property** in the Inspector. -3. Click the **"Open SSPJ" button** located next to the resource preview. +2. Click the **"Open SSPJ" button** shown at the top of the Inspector. This action automatically launches SpriteStudio and opens the underlying `.sspj` file, allowing you to start editing immediately. @@ -46,7 +45,7 @@ This action automatically launches SpriteStudio and opens the underlying `.sspj` After modifying and saving the animation in SpriteStudio, return to the Godot editor. With just the following steps, your changes will instantly reflect in the game (and in the editor preview). -1. As before, expand the **`SSAB Resource`** in the Inspector. +1. As before, select the node to show the Inspector. 2. Click the **"Reconvert" button** next to the "Open SSPJ" button. > [!IMPORTANT] diff --git a/docs/en/workflow/usage_basic.md b/docs/en/workflow/usage_basic.md index ef1684b..488e4c0 100644 --- a/docs/en/workflow/usage_basic.md +++ b/docs/en/workflow/usage_basic.md @@ -29,7 +29,7 @@ If you want to place the node in a specific location within an existing node hie 1. Add a `SpriteStudioPlayer2D` node to your scene tree using the "+" button in the Scene dock. 2. Select the added node and open the Inspector. -3. Drag and drop the `.ssab` file from the FileSystem dock into the **`SSAB Resource`** property box in the Inspector to attach it. +3. Drag and drop the `.ssab` file from the FileSystem dock into the **`Ssab`** property box in the Inspector to attach it. --- @@ -64,7 +64,7 @@ Once the node is selected, you can adjust various settings from Godot's Inspecto | Property | Type | Description | | -------------------------- | -------- | ------------------------------------------------------------------- | -| `SSAB Resource` | Resource | The target `SSABResource` (`.ssab` file) to play | +| `Ssab` | Resource | The target `SSABResource` (`.ssab` file) to play | | `Animation` | String | The name of the currently selected animation | | `Autoplay` | bool | Whether to play automatically when the game starts | | `Offset` | Vector2 | Drawing offset. Useful to shift visuals without changing the Node Transform | diff --git a/docs/en/workflow/usage_scripting.md b/docs/en/workflow/usage_scripting.md index 5ae2719..52887a5 100644 --- a/docs/en/workflow/usage_scripting.md +++ b/docs/en/workflow/usage_scripting.md @@ -71,12 +71,13 @@ func _ready(): ss_player.user_data.connect(_on_user_data) func _on_user_data(payload): + # payload is a Dictionary; only the keys that were set are present (string / integer / point / rect) # Example: Check the string set as user data and process accordingly - if payload.string_value == "play_footstep": + if payload.get("string") == "play_footstep": $AudioStreamPlayer.play() - elif payload.string_value == "attack_hit": - # Example of passing the damage amount using an integer value (Int) - var damage = payload.int_value + elif payload.get("string") == "attack_hit": + # Example of passing the damage amount using an integer value + var damage = payload.get("integer", 0) spawn_hitbox(damage) ``` @@ -86,17 +87,17 @@ func _on_user_data(payload): When you want to change character equipment in-game, you can dynamically replace the texture of specific parts (cell maps) from your code. -### Example: Changing Weapons +### Example: Changing Outfits ```gdscript -func change_weapon(): - # Apply a new texture to the cell map named "weapon_map" - var new_sword_texture = preload("res://assets/iron_sword.png") - ss_player.set_cellmap_texture("weapon_map", new_sword_texture) +func change_costume(): + # Use the cell map name defined in SpriteStudio (retrievable via get_cellmap_names(); shown under CellMap Overrides in the Inspector) + var new_costume_texture = preload("res://assets/sailor_uniform.png") + ss_player.set_cellmap_texture("Clothes 1", new_costume_texture) ``` This feature allows you to build an efficient avatar system without needing to prepare multiple animation variations for each part. > [!TIP] -> ![Before equipment change](../../assets/7-cellmap_override_before.png) -> ![After equipment change](../../assets/7-cellmap_override_after.png) +> ![Before outfit change](../../assets/7-cellmap_override_before.png) +> ![After outfit change](../../assets/7-cellmap_override_after.png) diff --git a/docs/ja/api/player.md b/docs/ja/api/player.md index 46c7c41..dde36f3 100644 --- a/docs/ja/api/player.md +++ b/docs/ja/api/player.md @@ -99,7 +99,7 @@ SpriteStudio 上でユーザーデータに設定した値が `Dictionary` と `frame` プロパティはアニメート可能なので、`AnimationPlayer` のタイムライン(音・メソッド呼び出し・他ノードなど他トラック)と同期させて SpriteStudio アニメをスクラブできます。 -1. `SpriteStudioPlayer2D` に通常どおり `SSAB Resource` を割り当て、`Animation` を選択。 +1. `SpriteStudioPlayer2D` に通常どおり `Ssab`(SSAB リソース)を割り当て、`Animation` を選択。 2. `AnimationPlayer` で、ノードの `frame` プロパティを対象に **プロパティトラック** を追加。 3. `frame` を時間に沿ってキーフレーム(例:尺に合わせて `0` → 最終フレーム)。`frame` は float なので補間されます。 4. `AnimationPlayer` を再生。 diff --git a/docs/ja/workflow/animation_player.md b/docs/ja/workflow/animation_player.md index f61bb80..3abe16e 100644 --- a/docs/ja/workflow/animation_player.md +++ b/docs/ja/workflow/animation_player.md @@ -24,7 +24,7 @@ SSPlayer を `AnimationPlayer` で制御するためには、まず対象の `.s 生成されたライブラリを実際にシーンへ適用する手順です。 1. **ノードの準備** - シーン上に `SpriteStudioPlayer2D` ノードを配置し、対象の `.ssab` を `SSAB Resource` にセットしておきます。 + シーン上に `SpriteStudioPlayer2D` ノードを配置し、対象の `.ssab` を `Ssab` にセットしておきます。 2. **AnimationPlayer の追加** シーン内に `AnimationPlayer` ノードを追加します。 3. **ターゲットの指定(重要!)** diff --git a/docs/ja/workflow/usage_asset_pipeline.md b/docs/ja/workflow/usage_asset_pipeline.md index 024d3c0..2a3156e 100644 --- a/docs/ja/workflow/usage_asset_pipeline.md +++ b/docs/ja/workflow/usage_asset_pipeline.md @@ -31,8 +31,7 @@ SpriteStudioPlayerForGodot は単にアニメーションを再生するだけ Godot で作業中に「もう少しアニメーションを微調整したい」と思った場合、わざわざ SpriteStudio を別で立ち上げてプロジェクトを探す必要はありません。 1. Godot エディタ上で、アニメーションを再生している **`SpriteStudioPlayer2D` ノードを選択**します。 -2. インスペクタの **`SSAB Resource` プロパティ** をクリックして展開します。 -3. リソースプレビューの横に用意されている **「Open SSPJ」ボタン** をクリックします。 +2. インスペクタ上部に表示される **「Open SSPJ」ボタン** をクリックします。 この操作により、SpriteStudio が起動して元となる `.sspj` ファイルが開き、すぐに編集作業に入ることができます。 @@ -46,7 +45,7 @@ Godot で作業中に「もう少しアニメーションを微調整したい SpriteStudio 側でアニメーションを修正して保存したら、Godot エディタに戻ります。 以下の操作だけで、変更内容がゲーム(およびエディタ上のプレビュー)に一瞬で反映されます。 -1. 先ほどと同様に、インスペクタの **`SSAB Resource`** を展開します。 +1. 先ほどと同様に、ノードを選択してインスペクタを表示します。 2. 「Open SSPJ」ボタンの横にある **「Reconvert」ボタン** をクリックします。 > [!IMPORTANT] diff --git a/docs/ja/workflow/usage_basic.md b/docs/ja/workflow/usage_basic.md index 6966aa8..723c4f9 100644 --- a/docs/ja/workflow/usage_basic.md +++ b/docs/ja/workflow/usage_basic.md @@ -29,7 +29,7 @@ Godot エディタの強力な機能を活かし、最短の手順でアニメ 1. シーンドックの「+」ボタンなどから、`SpriteStudioPlayer2D` ノードをシーンツリーに追加します。 2. 追加したノードを選択し、インスペクタを開きます。 -3. インスペクタの **`SSAB Resource`** プロパティへ、ファイルシステムドックから `.ssab` ファイルをドラッグ&ドロップしてアタッチします。 +3. インスペクタの **`Ssab`** プロパティへ、ファイルシステムドックから `.ssab` ファイルをドラッグ&ドロップしてアタッチします。 --- @@ -64,7 +64,7 @@ Godot エディタの強力な機能を活かし、最短の手順でアニメ | プロパティ | 型 | 説明 | | -------------------------- | ------ | ------------------------------------------------------------------- | -| `SSAB Resource` | Resource | 再生対象の `SSABResource` (`.ssab` ファイル) | +| `Ssab` | Resource | 再生対象の `SSABResource` (`.ssab` ファイル) | | `Animation` | String | 選択中のアニメーション名 | | `Autoplay` | bool | ゲーム開始時に自動再生するかどうか | | `Offset` | Vector2| 描画位置のオフセット。Transformを動かさずに見た目だけをずらす際に便利 | diff --git a/docs/ja/workflow/usage_scripting.md b/docs/ja/workflow/usage_scripting.md index 59f48c9..57d7d79 100644 --- a/docs/ja/workflow/usage_scripting.md +++ b/docs/ja/workflow/usage_scripting.md @@ -71,12 +71,13 @@ func _ready(): ss_player.user_data.connect(_on_user_data) func _on_user_data(payload): - # 例: ユーザーデータとして設定された文字列(String)を判定して処理 - if payload.string_value == "play_footstep": + # payload は Dictionary。設定されたキーのみ含まれる(string / integer / point / rect) + # 例: 文字列(string)を判定して処理 + if payload.get("string") == "play_footstep": $AudioStreamPlayer.play() - elif payload.string_value == "attack_hit": - # 整数値(Int)を使ってダメージ量などを渡す例 - var damage = payload.int_value + elif payload.get("string") == "attack_hit": + # 整数値(integer)を使ってダメージ量などを渡す例 + var damage = payload.get("integer", 0) spawn_hitbox(damage) ``` @@ -86,13 +87,13 @@ func _on_user_data(payload): ゲーム内でキャラクターの装備を変えたい場合など、特定のパーツ(セルマップ)のテクスチャをプログラムから動的に差し替えることができます。 -### 実装例: 武器の持ち替え +### 実装例: 衣装の着せ替え ```gdscript -func change_weapon(): - # "weapon_map" というセルマップに対し、新しいテクスチャを適用する - var new_sword_texture = preload("res://assets/iron_sword.png") - ss_player.set_cellmap_texture("weapon_map", new_sword_texture) +func change_costume(): + # セルマップ名は SpriteStudio で定義された名前(get_cellmap_names() で取得、インスペクタの CellMap Overrides に表示)を指定する + var new_costume_texture = preload("res://assets/sailor_uniform.png") + ss_player.set_cellmap_texture("Clothes 1", new_costume_texture) ``` この機能により、アニメーションデータをパーツごとに何パターンも用意することなく、効率的なアバターシステムを構築できます。