This commit is contained in:
Yoshman29
2022-11-28 21:48:30 +01:00
parent 3a95581bd1
commit 368df4b82c
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
1324
1325
+3 -1
View File
@@ -1,5 +1,6 @@
package funkin.cutscenes;
#if sys
import vlc.bitmap.VlcBitmap;
import flixel.util.FlxTimer;
import funkin.options.PlayerSettings;
@@ -172,4 +173,5 @@ class MP4Handler
if (FlxG.sound.volume <= 0.1 || FlxG.sound.muted)
bitmap.volume = 0;
}
}
}
#end
+7
View File
@@ -9,8 +9,10 @@ class VideoCutscene extends Cutscene {
var path:String;
var localPath:String;
#if sys
var video:MP4Handler;
var videoSprite:FlxSprite;
#end
var cutsceneCamera:FlxCamera;
public function new(path:String, callback:Void->Void) {
@@ -25,6 +27,7 @@ class VideoCutscene extends Cutscene {
cutsceneCamera.bgColor = 0;
FlxG.cameras.add(cutsceneCamera, false);
#if sys
video = new MP4Handler();
video.finishCallback = close;
video.canvasWidth = cutsceneCamera.width;
@@ -36,12 +39,16 @@ class VideoCutscene extends Cutscene {
add(videoSprite);
video.playMP4(localPath, false, videoSprite);
#end
cameras = [cutsceneCamera];
}
public override function update(elapsed:Float) {
super.update(elapsed);
#if !sys
close();
#end
}
public override function destroy() {
FlxG.cameras.remove(camera, true);