Author Topic: custom loading screen for every game.  (Read 21597 times)

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
custom loading screen for every game.
« on: September 17, 2017, 03:11:47 PM »
how to add a custom loading screen for every game that you have..

at some point we have all wanted a custom loading screen..
so when i saw the plugin for this i thought..ok
but one only!  common relay......

OK so this was trial an error,  but i found out how to

thanks to "Keilmillerjr's" plugin

#1 steps..  goto "sticky" modules and plugin gallery
download "fadetogame plugin"

#2 put in "plugins" folder

#3 open AM & "tab" "plugin" enable plugin.nut ,,save & exit

#4 goto "plugins folder" now edit "plugin.nut ,, edit this line to....

shade = fe.add_artwork("title", 0, 0, fe.layout.width, fe.layout.height); 

#5 goto "scraper" folder add new folder with system name ie: snes
in this folder add , "newfolder" > title

#6 in the new folder "snes > title" add your custum loading screen pic
and name it just like you would for snaps or videos  ie: Contra III - The Alien Wars.png

done, now when you start game it will show your custom loading screen for that game...

notes: in the plugin menu u can change the start time,,and exit time
now u need to set this to your prefrence
mine is.

to game run time       3000
from game time         500

ie: 3 sec
ie: 1/2 sec


preview = youtube =
https://youtu.be/sSH76LGraJQ

help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: custom loading screen for every game.
« Reply #1 on: September 17, 2017, 04:35:52 PM »
Looks great! We can incorporate this feature to the plugin as optional and fade after loading screen is shown for a specific time.?

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: custom loading screen for every game.
« Reply #2 on: August 27, 2018, 03:52:33 PM »
Looks great! We can incorporate this feature to the plugin as optional and fade after loading screen is shown for a specific time.?


I use this plugin in AM PC, but when I start the game I get a black screen, and there is no image of the game.
Can you explain more about the plugin?

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: custom loading screen for every game.
« Reply #3 on: August 27, 2018, 08:03:25 PM »
Looks great! We can incorporate this feature to the plugin as optional and fade after loading screen is shown for a specific time.?


I use this plugin in AM PC, but when I start the game I get a black screen, and there is no image of the game.
Can you explain more about the plugin?

That’s exactly what the plugin is supposed to do.

Jedione list details on how to slightly modify the plugin to show custom loading screens.

ryuuji

  • Sr. Member
  • ****
  • Posts: 109
    • View Profile
Re: custom loading screen for every game.
« Reply #4 on: August 28, 2018, 10:51:46 AM »
did the changes and made the folders + png but I get black screen only :-\

edit:
Works now! (looks strange ... used a logo png and is stretched and no colour on the logo is all black)
Seems that copy/paste the line provided in this topic over the one in the *.nut file did the job..... weird...
« Last Edit: August 28, 2018, 11:39:57 AM by ryuuji »

mono20

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: custom loading screen for every game.
« Reply #5 on: September 16, 2018, 04:16:39 PM »
podrías explicar de una manera mas entendible no se comprende gracias  :-[ :-[ :-[

mono20

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: custom loading screen for every game.
« Reply #6 on: December 14, 2018, 12:51:34 PM »
podrías dejar los archivos ya listos  :-\

johnodon

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: custom loading screen for every game.
« Reply #7 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.

Code: [Select]
// 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).

Code: [Select]
: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?

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: custom loading screen for every game.
« Reply #8 on: May 13, 2019, 12:04:24 PM »
You are setting all color values of the image r-0 g-0 b-0, so your artwork image will be solid black. It’s a quirky way I make a 1px image any solid color.

Where is the artwork coming from? Curious. I have been thinking about some sort of instruction. Searched emu movies and hyper spin two days ago and couldn’t find anything that would work. Settled on maybe parsing history.dat info and stripping unrelated data.

Was thinking about reworking this plugin somehow. My picknmix layout is just about done with cool animations. Reworking the fadetogame plugin is next logical step. Ideas?

johnodon

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: custom loading screen for every game.
« Reply #9 on: May 13, 2019, 12:30:10 PM »
OK...I only changed that one line per the instructions above.

Loading images are from ruckage on the retropie forum:  https://retropie.org.uk/forum/topic/10806/neo-geo-x-build/144

Direct link to loading screens:  https://mega.nz/#!DwEVBJ6I!QDgyA_T-9VuFZnQzQgc6DATGxLsZmGObCKLQ_jZ6imU

John
« Last Edit: May 13, 2019, 01:03:41 PM by johnodon »

myriadgamers

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: custom loading screen for every game.
« Reply #10 on: May 15, 2019, 10:42:47 AM »
I think this is super useful, I will be using it to load up control instructions for games I think. So can you use a default image for a whole system instead of per game?

Edit - So I changed it from a fade to a solid image, was more useful to me in this form. Any hint on shutting audio off so my snaps dont keep playing while I show control instructions?

// 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("controls", 0, 0, fe.layout.width, fe.layout.height);
      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;
               shade.alpha = 255;
               return true;
            }
            break;
         case Transition.FromGame:
            shade.visible = true;
            if (ttime < fromGameRunTime) {
               // Fade In
               //shade.alpha = (255 * (fromGameRunTime - ttime)) / fromGameRunTime;
               shade.alpha = 0;
               return true;
            }
            break;
      }
      return false;
   }
}
fe.plugin["FadeToGame"] <- FadeToGame();
« Last Edit: May 15, 2019, 12:46:16 PM by myriadgamers »
Arcade Machine 1:
AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

johnodon

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: custom loading screen for every game.
« Reply #11 on: May 15, 2019, 01:11:53 PM »
I think this is super useful, I will be using it to load up control instructions for games I think. So can you use a default image for a whole system instead of per game?

Edit - So I changed it from a fade to a solid image, was more useful to me in this form. Any hint on shutting audio off so my snaps dont keep playing while I show control instructions?


This is perfect and exactly what I was after.  Thanks for sharing the code changes to show a solid image.

I'll continue to see if I can find a way to mute audio from AM.  I'f I have any success I'll share here.

John

myriadgamers

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: custom loading screen for every game.
« Reply #12 on: May 15, 2019, 02:06:10 PM »
Glad I could help, don’t get me wrong my code changes are sloppy and a word of caution don’t change the time for the second variable to 0 when you adjusting game fade out times
Arcade Machine 1:
AMD 8350 black 4ghz 8 Cores
20 gigs of DDR 3 Ram
500 gb SSD
4 tb Storage drive

johnodon

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: custom loading screen for every game.
« Reply #13 on: May 15, 2019, 02:18:43 PM »
Glad I could help, don’t get me wrong my code changes are sloppy and a word of caution don’t change the time for the second variable to 0 when you adjusting game fade out times

I have them set to 3000 and 500 respectively.  I'll probably knock the FromGame down to something very low, but this is working great.  Just need to figure out the sound piece.

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: custom loading screen for every game.
« Reply #14 on: May 15, 2019, 04:52:17 PM »
Glad I could help, don’t get me wrong my code changes are sloppy and a word of caution don’t change the time for the second variable to 0 when you adjusting game fade out times

I have them set to 3000 and 500 respectively.  I'll probably knock the FromGame down to something very low, but this is working great.  Just need to figure out the sound piece.

I would create a transition callback within your layout and mute your objects audio.

I am very tired so bed early. Will work on this plugin tomorrow and try to add in some requests. This plugin was kind of a step and stone for my latest layout - so time to update. Keep the brainstorming.