この文書の現在のバージョンと選択したバージョンの差分を表示します。
次のリビジョン | 前のリビジョン | ||
wiki:defold:tips:009 [2016/04/30 14:03] step 作成 |
wiki:defold:tips:009 [2016/05/19 23:17] (現在) step |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
====== 009 Spineによる動きのあるキャラクターの作成 ====== | ====== 009 Spineによる動きのあるキャラクターの作成 ====== | ||
- | 近日執筆予定… | + | Defoldでは標準でSpineに対応しています。Spineについては[[http://ja.esotericsoftware.com/|こちら]]を参照して下さい。 |
+ | |||
+ | ===== Spineデータのインポート ===== | ||
+ | |||
+ | Project Explorerにheroフォルダを作成し、さらにimageフォルダを作成。その中にSpineに利用するテクスチャを追加します。 | ||
+ | {{:wiki:defold:tips:2016051901.png|}} | ||
+ | |||
+ | さらにheroフォルダの中にアニメーションを定義したjsonファイルを追加します。 | ||
+ | {{:wiki:defold:tips:2016051902.png|}} | ||
+ | |||
+ | |||
+ | heroを右クリック→NewからSpine Scene File を選択します。 | ||
+ | {{:wiki:defold:tips:2016051903.png|}} | ||
+ | |||
+ | |||
+ | 名前はhero.spinesceneとしました。選択するとSpineSceneのプロパティを設定する項目が表示されます。 | ||
+ | {{:wiki:defold:tips:2016051904.png|}} | ||
+ | |||
+ | プロパティを設定します。jsonファイルは先ほどheroフォルダに追加したhero.jsonを、atlasは先ほどimage以下に追加したテクスチャをatlasにし設定します。 | ||
+ | {{:wiki:defold:tips:2016051905.png|}} | ||
+ | |||
+ | 次にheroを右クリック→New→Game Object Fileを選択しhero.go ゲームオブジェクトを作成します。 | ||
+ | {{:wiki:defold:tips:2016051906.png|}} | ||
+ | |||
+ | |||
+ | ==== GameObjectにSpineコンポーネントを割り当てる ==== | ||
+ | hero.goを選択した状態でOutlineを編集します。OutlineのGame Objectを選択した状態でIキーを入力。 | ||
+ | コンポーネントの追加ダイアログが表示されるので、SpineModelを選択します。 | ||
+ | {{:wiki:defold:tips:2016051907.png|}} | ||
+ | |||
+ | ===== SpineModelのプロパティを設定 ===== | ||
+ | * SpineSceneに作成したhero.spinescene を設定 | ||
+ | * Default Animationにidle_rightを設定 | ||
+ | {{:wiki:defold:tips:2016051908.png|}} | ||
+ | |||
+ | ==== シーン(main.collection)に配置してみる ==== | ||
+ | Project Explorer のmain/main.collection を開き、Outlineからshift+Iキーを入力しhero.goゲームオブジェクトを追加します。 | ||
+ | {{:wiki:defold:tips:2016051909.png|}} | ||
+ | |||
+ | |||
+ | ===== 実行確認 ===== | ||
+ | Ctrl+Bでビルド実行します。 | ||
+ | {{:wiki:defold:tips:2016051910.png|}} |