6
« on: May 13, 2019, 09:58:55 AM »
Can someone confirm that this is still working in the current version of AM (v2.5.1)? I cannot get the plugin to show the loading scree. It only fades to black and then into the game.
I edited the .nut file and enabled the plugin.
// Layout User Options
class UserConfig </ help="Plugin fades the screen when transitioning to and from a game." /> {
</ label="To Game Run Time",
help="The amount of time in milliseconds to run the fade to game.",
order=1 />
toGameRunTime="500";
</ label="From Game Run Time",
help="The amount of time in milliseconds to run the fade from game.",
order=2 />
fromGameRunTime="500";
}
// FadeToGame
class FadeToGame {
user_config = null;
toGameRunTime = null;
fromGameRunTime = null;
shade = null;
constructor() {
user_config = fe.get_config();
toGameRunTime = user_config["toGameRunTime"].tointeger();
fromGameRunTime = user_config["fromGameRunTime"].tointeger();
shade = fe.add_artwork("title", 0, 0, fe.layout.width, fe.layout.height);
shade.set_rgb(0, 0, 0);
shade.visible = false;
shade.zorder = 9999;
fe.add_transition_callback(this, "transitions");
}
function transitions(ttype, var, ttime) {
switch(ttype) {
case Transition.ToGame:
shade.visible = true;
if (ttime < toGameRunTime) {
// Fade Out
shade.alpha = (255 * (ttime - toGameRunTime)) / toGameRunTime;
return true;
}
break;
case Transition.FromGame:
shade.visible = true;
if (ttime < fromGameRunTime) {
// Fade In
shade.alpha = (255 * (fromGameRunTime - ttime)) / fromGameRunTime;
return true;
}
break;
}
return false;
}
}
fe.plugin["FadeToGame"] <- FadeToGame();
I am putting my loading screens in ~/.attract/scraper/mame/title
The loading screens are all PNG and have the same name as the rom (i.e. 1943.png).
:home/arcade/.attract/scraper/mame/title$ ls -la
total 136
drwxr-xr-x 2 odonnellj odonnellj 4096 May 13 12:35 .
drwxr-xr-x 8 odonnellj odonnellj 4096 May 13 12:23 ..
-rwxr--r-- 1 odonnellj odonnellj 78398 Jul 22 2017 1943.png
-rwxr--r-- 1 odonnellj odonnellj 45354 Jul 22 2017 popeye.png
Am I doing something wrong?