271
Scripting / Re: Adding loading video
« on: January 24, 2017, 01:08:24 PM »Make sure your layer is top most and just toggle visibility or opacity for fade.
Yes , but the thing is , AM starts playing the mp4 file when starts the layout , not when I launch the game.
It plays on the background even with opacity 0.
So when it fades in , can be playing on second 1 or second 20 its totally random.
I need a function or wathever to start the video only when I launch the game not before.
You need to stop and the video from playing and then have it start playing when during your transition. See layout.md. If you still have trouble, put your code in the post and I'll look at it when I get out from work.
I made this:
Code: [Select]
{
local basebar = fe.add_image( "loading/basebar.mp4", 0, 0, flw, flh );
basebar.alpha=0;
local alphabase_cfg = {
when = Transition.ToGame,
property = "alpha",
start = 0,
end = 255,
time = 100
delay = 1000
}
animation.add( PropertyAnimation( basebar, alphabase_cfg ) );
local hidebase_cfg = {
when = Transition.FromGame,
property = "alpha",
start = 255,
end = 0,
time = 100
wait = true
}
animation.add( PropertyAnimation( basebar, hidebase_cfg ) );
}
Maybe using video_flags (Vid.NoAutoStart) but I want to autoplay my videosnaps.