some updates

This commit is contained in:
Kade M
2021-06-16 13:52:04 -07:00
parent d103f5f507
commit 4454a25d5b
13 changed files with 812 additions and 610 deletions

View File

@ -1,6 +1,7 @@
// this file is for modchart things, this is to declutter playstate.hx
// Lua
import openfl.display3D.textures.VideoTexture;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
#if windows
@ -417,6 +418,33 @@ class ModchartState
// hud/camera
Lua_helper.add_callback(lua,"initBackgroundVideo", function(videoName:String) {
trace('playing assets/videos/' + videoName + '.webm');
PlayState.instance.backgroundVideo("assets/videos/" + videoName + ".webm");
});
Lua_helper.add_callback(lua,"pauseVideo", function() {
if (!GlobalVideo.get().paused)
GlobalVideo.get().pause();
});
Lua_helper.add_callback(lua,"resumeVideo", function() {
if (GlobalVideo.get().paused)
GlobalVideo.get().pause();
});
Lua_helper.add_callback(lua,"restartVideo", function() {
GlobalVideo.get().restart();
});
Lua_helper.add_callback(lua,"setVideoSpritePos", function(x:Int,y:Int) {
PlayState.instance.videoSprite.setPosition(x,y);
});
Lua_helper.add_callback(lua,"setVideoSpriteScale", function(scale:Float) {
PlayState.instance.videoSprite.setGraphicSize(Std.int(PlayState.instance.videoSprite.width * scale));
});
Lua_helper.add_callback(lua,"setHudAngle", function (x:Float) {
PlayState.instance.camHUD.angle = x;