You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get a video to play in the background of the song while the Hud is still visible. I have this lua file in my 'scripts' folder
--[[
Made By BBPanzu
Improved By Cherry
A Bit Fix By Laztrix
How To Use:
Put script in scripts folder
if you want to use it on a certain script add a local or global variable called video sprite which equals
dofile("mods/scripts/videoSprite.lua")
to make the sprite do
makeVideoSprite("tag", "path", x, y, "Camera")
for the camera you can put
-camHUD
-camGame
-other
]]--
-- [[the stuff ]] --
function onCreate()
addHaxeLibrary('MP4Handler', 'vlc')
addHaxeLibrary('Event', 'openfl.events')
end
local videoSprites = {}
function makeVideoSprite(tag, videoPath, x, y, camera)
makeLuaSprite(tag, '', x, y)
setObjectCamera(tag, camera)
addLuaSprite(tag, false)
runHaxeCode([[
]]..tag..[[= new MP4Handler();
]]..tag..[[.playVideo(CarVideoMissing);
]]..tag..[[.visible = false;
FlxG.stage.removeEventListener("enterFrame", ]]..tag..[[.update);
]]..tag..[[.finishCallback = function()
{
game.getLuaObject("]]..tag..[[").visible = false;
}
]])
table.insert(videoSprites, tag)
--debugPrint('bro the video has been started!')
end
function onUpdatePost()
for _, __ in pairs(videoSprites) do
runHaxeCode([[
if (game.getLuaObject("]]..__..[[") != null)
{
game.getLuaObject("]]..__..[[").loadGraphic(]]..__..[[.bitmapData);
]]..__..[[.volume = FlxG.sound.volume + 0.4;
}
]])
end
end
function onPause()
for _, __ in pairs(videoSprites) do
runHaxeCode([[
]]..__..[[.pause();
]])
end
end
function onResume()
for _, __ in pairs(videoSprites) do
runHaxeCode([[
]]..__..[[.resume();
]])
end
end`
"CarVideoMissing" is the template video that im trying to get to play with this script, the video is in my 'videos' folder.
In my stage file i have this code:
`function onCreatePost()
setProperty('boyfriend.visible', false)
setProperty('gf.visible', false)
setProperty('dad.visible', false)
setProperty('healthBar.visible', false)
setProperty('healthBarBG.visible', false)
setProperty('iconP1.visible')
setProperty('iconP2.visible')
end
function onUpdate()
if canDodge == true and keyJustPressed('enter') then
pauseVideoSprite('CarVideoMissing')
end
end
function onSongStart()
callScript('scripts/videoSprite', 'makeVideoSprite', {'CarVideoMissing', 'CarVideoMissing', -320, -170, 'camHUD'})
setScrollFactor('Dl', 0, 0)
scaleObject('CarVideoMissing', 0.65, 0.65)
end`
The video however doesnt play and I only receive this black screen:
Any help will be appreciated I am rather lost on what to do/what im missing exactly.
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
Nothing is edited
The text was updated successfully, but these errors were encountered:
Describe your problem here.
I'm trying to get a video to play in the background of the song while the Hud is still visible. I have this lua file in my 'scripts' folder
"CarVideoMissing" is the template video that im trying to get to play with this script, the video is in my 'videos' folder.
In my stage file i have this code:
The video however doesnt play and I only receive this black screen:
Any help will be appreciated I am rather lost on what to do/what im missing exactly.
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
Nothing is edited
The text was updated successfully, but these errors were encountered: