Author Topic: Add loading video  (Read 3095 times)

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Adding loading video
« Reply #15 on: January 26, 2017, 01:52:51 PM »
I could make a plugin to do this if. However, it would be useless unless attractmode actually launches the rom in the background and waits until the transition to game is completed. Does it do this?

I think that is exactly how it works because I did something similar with a png sequence and seems to be waiting in the background.
Could be awesome a plugin to add transitions to game and from game.

Cool. I'll work on it and hopefully have something preliminary released by the end of the weekend. I already made a class for an intro video that I can modify for this.

jedione

  • Hero Member
  • *****
  • Posts: 525
  • punktoe
    • View Profile
Re: Adding loading video
« Reply #16 on: January 26, 2017, 02:29:31 PM »
Please make a plugin,    that would be great.
help a friend....

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Add loading video
« Reply #17 on: February 19, 2017, 10:49:08 PM »
This is the code I have so far. Redrawing will make the video appear to never play. Regardless, AttractMode does not launch rom in the background. I am thinking that a true loading screen is impossible at the moment.

Code: [Select]
// Layout User Options
class UserConfig </ help="A plugin that helps create await screens." /> {
</ label="Video Path",
help="The path of the video you want to display.",
order=1 />
videoPath="loading.mp4";
</ label="Run Time",
help="The run time of the video you want to display.",
order=2 />
runTime="5000";
}

// Load Debug Module
local log = null;
if (fe.load_module("Debug")) log = Log();

// Await
class Await {
config = null;
videoPath = "";
runTime = 0;
video = null;

constructor() {
config = fe.get_config();
videoPath = config["videoPath"];
runTime = config["runTime"].tointeger();

video = fe.add_image(videoPath, 0, 0, fe.layout.width, fe.layout.height);
video.video_flags = Vid.NoAutoStart;
video.video_playing = false;
video.visible = false;
video.zorder = 9999;

fe.add_transition_callback(this, "transitions");
}

function transitions(ttype, var, ttime) {
switch(ttype) {
case Transition.ToGame:
if (ttime < runTime) {
video.visible = true;
video.video_playing = true;
return true;
}
break;
case Transition.FromGame:
video.visible = false;
break;
}
return false;
}
}
fe.plugin["Await"] <- Await();

« Last Edit: February 19, 2017, 11:39:37 PM by keilmillerjr »

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Add loading video
« Reply #18 on: March 10, 2017, 08:32:55 AM »
Thanks for the effort.
We can use rocketlauncher to this but I would like to have an oprtion using only AM.
Maybe on future versions, who knows.