画像を変形させる
Posted 2013.02.27 in 流動指向ゲームエンジン『Fooo』
ユニバーサルトランジッションやクロスフェードトランジッションでは
結局のところ画像をフェードさせることしかできない。
画像を変形させるような演出にはまた別の機能を使用する。
Transform命令
Transform命令はその名のとおり画像を変形させる命令である。
Transform(to="画像1", effect="LinearLeft", time=1000);
effectパラメータには、変形効果の種類を指定する。
かなりの種類があるのだが、いくつか紹介しておこう。
![]() |
![]() |
![]() |
![]() |
![]() |
LinearLeft | BlindLeft | CurtainLeft | ShaveLeft | SlashH |
![]() |
![]() |
![]() |
![]() |
![]() |
BoxCenter | HoleCenter | FanCenter | TensileLeft | Mosaic |
ユニバーサルトランジッションを使えば実現できるものも多いが
わざわざ画像を用意する必要がない分、場合によってはこっちの方が簡単だ。
さっそく使ってみよう。
method Main()
{
CreateImage(name="画像2", image="画像2.png");
CreateImage(name="画像1", image="画像1.png");
Enter(to="画像1");
wait 1000;
Transform(to="画像1", effect="LinearLeft", time=1000);
}

他の変形も試してみよう。
メソッド化して簡潔に記述する。
method Test(string $effect)
{
Transform(to="画像1", effect=$effect, time=1000);
wait 1000;
Transform(to="画像1", effect=$effect, time=1000, begin=100%, end=0%);
wait 1000;
}
method Main()
{
CreateImage(name="画像2", image="画像2.png");
CreateImage(name="画像1", image="画像1.png");
Enter(to="*");
wait 1000;
call @Test(effect="LinearLeft");
call @Test(effect="BlindLeft");
call @Test(effect="CurtainLeft");
call @Test(effect="ShaveLeft");
call @Test(effect="SlashH");
call @Test(effect="BoxCenter");
call @Test(effect="HoleCenter");
call @Test(effect="FanCenter");
call @Test(effect="TensileLeft");
call @Test(effect="Mosaic");
}
トランスフォームは単に画像を変形させるだけで、
厳密には画像を入れ替える演出ではないが、主にトランジッション効果として使用する。