![見出し画像](https://assets.st-note.com/production/uploads/images/82818470/rectangle_large_type_2_f2493432447d60e873db872cd1a12a48.png?width=1200)
【ティラノビルダー】ソーシャルゲーム風のホーム画面の作成方法
【ティラノビルダー】ソーシャルゲーム風のホーム画面の作成方法 サンプル動画 pic.twitter.com/uxnaWrqjca
— サイバーノーツ (@Cyber_Noughts) July 17, 2022
今回は、ソーシャルゲーム風のホーム画面を作成します。
キャラクターの立ち絵・スチルが表示される
プレイヤー側で好きな立ち絵・スチルに変更できる
セリフが流れる
ストーリーに移動するための分岐ボタンが表示される
以上の機能を実装します。
【使用素材】
わたおきば様の立ち絵を使用させていただきました。
【準備】
シナリオを新規作成し、シナリオ名をep1とします。
①画像の配置
![](https://assets.st-note.com/img/1657946095569-TGhn0UBeE0.png?width=1200)
プロジェクト一覧画面からフォルダのアイコンをクリックし、作業中のプロジェクトのフォルダを開きます。
![](https://assets.st-note.com/img/1657946246953-dYov2xV6Ws.png?width=1200)
imageフォルダをクリックします。
![](https://assets.st-note.com/img/1657946355019-HOtN3LpWYx.png?width=1200)
画像を配置するフォルダを新規作成します。
![](https://assets.st-note.com/img/1657946793738-txw1FctuNs.png?width=1200)
画像を配置します。
これで、画像の配置は完了です。
②キャラクターの追加
![](https://assets.st-note.com/img/1658020111372-yuaBPQQCON.png?width=1200)
「プロジェクト」→「キャラクター管理」をクリックし、キャラクター管理画面を開きます。
![](https://assets.st-note.com/img/1657953497756-PQE2eMrB5l.png?width=1200)
今回はキャラクター名をakaneとしました。
キャラクターの画像を登録します。
これで、キャラクターの追加は完了です。
③scene1の編集
![](https://assets.st-note.com/img/1658020261624-TQb21pPCOk.png?width=1200)
全体の画像です。
(1) 背景・立ち絵の初期設定
![](https://assets.st-note.com/img/1658021157273-SQxTXAQyMr.png?width=1200)
iscriptコンポーネントを配置します。
if ( sf.bg == undefined ) {
sf.bg = 'bg_base.png';
}
if ( sf.face == undefined ) {
sf.face = 'chara/1/a.png';
}
コードを貼り付けます。
【デフォルトの背景】
bg_base.png
【デフォルトの立ち絵】
chara/1/a.png
デフォルトの背景・立ち絵を変更したい場合は、
bg_base.png・chara/1/a.pngを変更します。
(2) 背景の表示
![](https://assets.st-note.com/img/1658021168434-6ZOe4hiDkN.png?width=1200)
ティラノスクリプトコンポーネントを配置します。
[bg storage="&sf.bg" time="1000" method="crossfade"]
コードを貼り付けます。
(3) キャラクターの表示
![](https://assets.st-note.com/img/1658021181780-kbqAiMvpcZ.png?width=1200)
ティラノスクリプトコンポーネントを配置します。
[chara_show name="akane" time="1000" wait="true" storage="&sf.face" width="400" height="1100" top="100"]
コードを貼り付けます。
(4) ボタンの表示
![](https://assets.st-note.com/img/1658021205994-kpHPaU5pgf.png?width=1200)
ティラノスクリプトコンポーネントを配置します。
[button graphic="home/bg_base.png" target="*bg" x="860" y="30" width="80" height="60" fix="true" exp="sf.bg = 'bg_base.png'" name="home"]
[button graphic="home/room.png" target="*bg" x="960" y="30" width="80" height="60" fix="true" exp="sf.bg = 'room.jpg'" name="home"]
[button graphic="home/rouka.png" target="*bg" x="1060" y="30" width="80" height="60" fix="true" exp="sf.bg = 'rouka.jpg'" name="home"]
[button graphic="home/title.png" target="*bg" x="1160" y="30" width="80" height="60" fix="true" exp="sf.bg = 'title.jpg'" name="home"]
[button graphic="home/a.png" target="*face" x="850" y="130" width="100" height="100" fix="true" exp="sf.face = 'chara/1/a.png'" name="home"]
[button graphic="home/b.png" target="*face" x="950" y="130" width="100" height="100" fix="true" exp="sf.face = 'chara/1/b.png'" name="home"]
[button graphic="home/c.png" target="*face" x="1050" y="130" width="100" height="100" fix="true" exp="sf.face = 'chara/1/c.png'" name="home"]
[button graphic="home/d.png" target="*face" x="1150" y="130" width="100" height="100" fix="true" exp="sf.face = 'chara/1/d.png'" name="home"]
[button graphic="home/e.png" target="*face" x="850" y="250" width="100" height="100" fix="true" exp="sf.face = 'chara/1/e.png'" name="home"]
[button graphic="home/f.png" target="*face" x="950" y="250" width="100" height="100" fix="true" exp="sf.face = 'chara/1/f.png'" name="home"]
[button graphic="home/g.png" target="*face" x="1050" y="250" width="100" height="100" fix="true" exp="sf.face = 'chara/1/g.png'" name="home"]
[button graphic="home/h.png" target="*face" x="1150" y="250" width="100" height="100" fix="true" exp="sf.face = 'chara/1/h.png'" name="home"]
コードを貼り付けます。
【画像の位置】
x:横位置
y:縦位置
【画像の大きさ】
width:横幅
height:縦幅
(5) 背景・立ち絵の変更
![](https://assets.st-note.com/img/1658021244273-pqAZeFySNz.png?width=1200)
ティラノスクリプトコンポーネントを配置します。
*bg
[bg storage="&sf.bg" time="500"]
[return]
[s]
*face
[chara_mod name="akane" storage="&sf.face" time="300" cross="false"]
[return]
コードを貼り付けます。
(6) ボタンの消去
![](https://assets.st-note.com/img/1658021267639-C2Ytl5ufMN.png?width=1200)
ティラノスクリプトコンポーネントを配置します。
[clearfix name="home"]
コードを貼り付けます。
以上で解説を終わります。おつかれさまでした。
この記事が気に入ったらサポートをしてみませんか?