1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-22 23:03:36 +00:00

Fix some issues with cutscenes.

This commit is contained in:
EliteMasterEric 2024-02-22 20:56:41 -05:00
parent 539b688055
commit 01ed1730f4
4 changed files with 31 additions and 5 deletions

View file

@ -108,7 +108,7 @@
<haxelib name="flixel-text-input" /> <!-- Improved text field rendering for HaxeUI -->
<haxelib name="polymod" /> <!-- Modding framework -->
<haxelib name="flxanimate" /> <!-- Texture atlas rendering -->
<haxelib name="hxCodec" if="desktop release" /> <!-- Video playback -->
<haxelib name="hxCodec" if="desktop" /> <!-- Video playback -->
<haxelib name="json2object" /> <!-- JSON parsing -->
<haxelib name="thx.semver" /> <!-- Version string handling -->

View file

@ -16,6 +16,20 @@ class Paths
currentLevel = name.toLowerCase();
}
public static function stripLibrary(path:String):String
{
var parts = path.split(':');
if (parts.length < 2) return path;
return parts[1];
}
public static function getLibrary(path:String):String
{
var parts = path.split(':');
if (parts.length < 2) return "preload";
return parts[0];
}
static function getPath(file:String, type:AssetType, library:Null<String>)
{
if (library != null) return getLibraryPath(file, library);

View file

@ -36,6 +36,8 @@ class VideoCutscene
return;
}
var rawFilePath = Paths.stripLibrary(filePath);
// Trigger the cutscene. Don't play the song in the background.
PlayState.instance.isInCutscene = true;
PlayState.instance.camHUD.visible = false;
@ -49,10 +51,10 @@ class VideoCutscene
#if html5
playVideoHTML5(filePath);
#end
#if hxCodec
playVideoNative(filePath);
#elseif hxCodec
playVideoNative(rawFilePath);
#else
throw "No video support for this platform!";
#end
}
@ -110,6 +112,15 @@ class VideoCutscene
PlayState.instance.refresh();
vid.play(filePath, false);
// Resize videos bigger or smaller than the screen.
vid.bitmap.onTextureSetup.add(() -> {
vid.setGraphicSize(FlxG.width, FlxG.height);
vid.updateHitbox();
vid.x = 0;
vid.y = 0;
// vid.scale.set(0.5, 0.5);
});
}
else
{

View file

@ -7,6 +7,7 @@ import flixel.addons.ui.FlxInputText;
import flixel.FlxCamera;
import flixel.FlxGame;
import flixel.FlxSprite;
import funkin.graphics.FunkinSprite;
import flixel.FlxState;
import flixel.group.FlxGroup;
import flixel.group.FlxGroup.FlxTypedGroup;