video cutscene fixes

This commit is contained in:
⍚~Nex
2025-01-20 19:21:29 +01:00
parent 1aa136469d
commit 4ae7e045b1
2 changed files with 12 additions and 3 deletions
@@ -62,6 +62,14 @@ class VideoCutscene extends Cutscene {
video.antialiasing = true;
video.autoPause = false; // Imma handle it better inside this class, mainly because of the pause menu - Nex
video.bitmap.onEndReached.add(close);
video.bitmap.onFormatSetup.add(function() if (video.bitmap != null && video.bitmap.bitmapData != null) {
final width = video.bitmap.bitmapData.width;
final height = video.bitmap.bitmapData.height;
final scale:Float = Math.min(FlxG.width / width, FlxG.height / height);
video.setGraphicSize(Std.int(width * scale), Std.int(height * scale));
video.updateHitbox();
video.screenCenter();
});
//cover = new FlxSprite(0, FlxG.height * 0.85).makeSolid(FlxG.width + 50, FlxG.height + 50, 0xFF000000);
//cover.scrollFactor.set(0, 0);
@@ -236,6 +244,7 @@ class VideoCutscene extends Cutscene {
public override function destroy() {
FlxG.cameras.remove(cutsceneCamera, true);
video.destroy();
super.destroy();
}
#end