Godot で Transition を自作する
CanvasLayer で仲介する方法
https://www.youtube.com/watch?v=yZQStB6nHuI
get_tree().change_scene()を仲介する Canvas node を自作し、その中で AnimationPlayer で transition を実行すればいける
Godot 3.5ベースのコードだが、yield を await にして、change_scene()をchange_scene_to_file()にすればGodot 4.0でも動く AniamtionPlayer では 初期化のためのRESET アニメーションを追加している
we add an AnimationPlayer node with two animations: RESET and dissolve. In case you’re unfamiliar with it, the RESET animation is special animation in Godot and will run whenever the game starts so that you can make sure you have a consistent starting point for your animations. We’ll use this to make it so our dissolve rectangle always defaults to invisible by adding a keyframe while its modulate alpha is 0.
RESETという名前のアニメーションは、Godot の予約語で、勝手に初期化で呼ばれるらしい
Shader を使う方法
https://www.youtube.com/watch?v=K9FBpJ2Ypb4
shader にマスク画像をアタッチして、Transition させる
パキッとさせるか、スムーズにするかは smoothstep()関数を使って調整できる