アニメファイル の変更点 - Polaris Engine Wiki

Wikiトップ   編集   新規作成   複製   名称変更   アップロード   添付ファイル一覧   バックアップ  

 

#author("2024-04-14T01:19:56+09:00","default:discord","discord")
#author("2024-04-14T01:23:02+09:00","default:discord","discord")
* アニメの基本 [#maf9c461]
@animeコマンドでアニメファイルを再生できます。

@anime の移動・拡大・縮小、resetを用いたサンプルゲームはこちらです。
@anime の移動・拡大・縮小、resetを用いた[[サンプルゲームはこちら:https://polaris-engine.com/wiki/?plugin=attach&pcmd=open&file=anime.zip&refer=%E3%82%A2%E3%83%8B%E3%83%A1%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB]]です。

メッセージボックスを1秒かけて右側に100pxずらすには、下記のアニメファイルを作成し、animeフォルダに入れます。

 move {
     layer: msg;
     clear: all;
     start: 0.0;
     end: 1.0;
     from-x: +0;
     from-y: +0;
     from-a: 255;
     to-x: +100;
     to-y: +0;
     to-a: 255;
 }

clear:all;は、1つのレイヤーについて複数の移動を連続で記述するときに、最初の移動にだけ付けます。

以前は、file: ファイル名;を指定すると、レイヤーにcgフォルダの画像を読み込めましたが、@layerコマンドに置き換えられました。


* レイヤーの構成 [#g95b6484]

現時点では上から順に下記の構成です。

 text8
 text7
 text6
 text5
 text4
 text3
 text2
 text1
 
 chf  (キャラ顔)
 name (名前ボックス、画像変更はアニメからはできない)
 msg  (メッセージボックス、画像変更はアニメからはできない)
 
 effect4
 effect3
 effect2
 effect1
  
 chc  (中央キャラ)
 chrc  (右中キャラ)
 chr  (右キャラ)
 chlc  (左中キャラ)
 chl  (左キャラ)
 chb  (背面キャラ)
 
 effect8
 effect7
 effect6
 effect5
  
 bg2
 bg   (背景, 今のところアルファ値は255固定)

effect1からeffect4は、雨のアニメーションや、色味を加えるのに使えます。
text1からtext8は、@pencilコマンドでテキストを描画するのに使えます。


* アニメでの拡大、縮小、回転 [#ua2e6980]

 test1 {
     layer: effect1;
  
     clear: all;
 
     start: 0.0;
     end: 3.0;
 
     from-x: 0;
     from-y: 400;
     from-a: 255;
 
     to-x: 0;
     to-y: 400;
     to-a: 255;
 
     # 画像内での拡大縮小・回転の中心座標
     center-x: 600;
     center-y: 100;
 
     # 拡大率 
     from-scale-x: 1.0;
     from-scale-y: 1.0;
     to-scale-x: 2.0;
     to-scale-y: 2.0;
  
    # 回転(プラスだと右回り、マイナスだと左回り)
     from-rotate: 0.0;
     to-rotate: -360;
 }
 test2 {
     layer: effect1;
 
     start: 3.0;
     end: 6.0;
 
     from-x: 0;
     from-y: 400;
     from-a: 255;
 
     to-x: 0;
     to-y: 400;
     to-a: 255;
 
     center-x: 600;
     center-y: 100;
 
     from-scale-x: 2.0;
     to-scale-x: 1.0;
 
     from-scale-y: 2.0;
     to-scale-y: 1.0;
 
     from-rotate: -360;
     to-rotate: 0;
  }


* アニメのリセット [#wc4e3b2d]

例えば拡大した後、縮小のアニメファイルを別で用意するのも、画面を元に戻す一つの手段です。

しかし、アニメーションを使わずパッと一気に戻すのであれば、@anime reset を利用することもできます。

 @anime reset layer-bg,xy,scale,rotate
 @anime reset layer-chc,xy,scale,rotate
 @anime reset layer-all,xy,scale,rotate

layer-bg だと背景、layer-chcだと立ち絵中央、layer-allだと全てのレイヤーをリセットし、アニメ前の状態に戻します。

xyはx位置/y位置、scaleは拡大率、rotateは回転のことを指し、単体のみでも複数でも指定できます。

例えば下のように書くと、背景の拡大率のみをリセットすることが可能です。

 @anime reset layer-bg,scale