new startup animation?

it's a video so it goes over the skip text which is bad. however it's more efficient than converting the video into a spritesheet
This commit is contained in:
JordanSantiagoYT
2024-09-13 23:56:06 -04:00
parent 2b5e4ce423
commit f22445d4cb
2 changed files with 30 additions and 1 deletions

Binary file not shown.

View File

@@ -2,12 +2,24 @@ package;
import flixel.input.keyboard.FlxKey;
#if VIDEOS_ALLOWED
#if (hxCodec >= "3.0.0" || hxCodec == "git")
import hxcodec.flixel.FlxVideo as MP4Handler;
#elseif (hxCodec == "2.6.1")
import hxcodec.VideoHandler as MP4Handler;
#elseif (hxCodec == "2.6.0")
import VideoHandler as MP4Handler;
#else
import vlc.MP4Handler;
#end
#end
class StartupState extends MusicBeatState
{
var logo:FlxSprite;
var skipTxt:FlxText;
var theIntro:Int = FlxG.random.int(0, 1);
var theIntro:Int = FlxG.random.int(0, #if VIDEOS_ALLOWED 2 #else 1 #end);
override public function create():Void
{
@@ -47,6 +59,23 @@ class StartupState extends MusicBeatState
logo.updateHitbox();
logo.screenCenter();
FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1}, 1.35, {ease: FlxEase.expoOut, onComplete: _ -> onIntroDone()});
case 2:
#if VIDEOS_ALLOWED
var vidSprite = new MP4Handler(); // it plays but it doesn't show???
#if (hxCodec < "3.0.0")
vidSprite.playVideo(Paths.video('bambiStartup'), false, false);
vidSprite.finishCallback = function()
{
FlxG.switchState(TitleState.new);
};
#else
vidSprite.play(Paths.video('bambiStartup'));
vidSprite.onEndReached.add(function(){
vidSprite.dispose();
FlxG.switchState(TitleState.new);
});
#end
#end
}
});