Author Topic: Change the background when changing systems  (Read 2604 times)

treme

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Change the background when changing systems
« on: March 30, 2022, 07:08:24 AM »
Hello, first I apologize for any spelling mistakes, I don't speak English very well and I'm using a translator.

After knowing how Attract mode works as well as I could, I wanted to go on to make a Theme to learn a little more.


I have made some to see how the nut file works and all that and I have managed to make some, simple but functional
Now I was trying to do something, which I can't make it work, because from the menu an image appears in the background of the system that is selected, the problem is that if I change the system, the background image doesn't change and What I want is for it to change, if I'm in the megadrive system, a megadrive comes out in the background, but if I change to the nintendo system, a nintendo comes out in the background

If someone can tell me how this can be done, I would appreciate it, if you need anything, whether it is the layout.nut or how I have the files placed, please tell me and I will put it

Thank you very much


Mark Norville

  • Sr. Member
  • ****
  • Posts: 233
    • View Profile
Re: Change the background when changing systems
« Reply #1 on: March 30, 2022, 07:16:33 AM »
The best way of doing this, is to find a skin that does what you want, and then have a look at the nutfile to see how it is done.

I just checked one of mine, and this should be similar to what you want it to do

if ( my_config["big_art"] == "Snap" )

{
local snap = fe.add_artwork("snap", flx*0, fly*0, flw, flh);
snap.preserve_aspect_ratio = false;
}

Just replace the snap for background or what other artwork you want.

It should all change when you switch to a new system, just make sure you have the following

Emulator : Sega Megadrive
Artwork : Sega Megadrive.jpg .png etc

If you have named it wrongly such as Sega Mega Drive.jpg then it will not show, so check your spellings and images.

However, a nut file would help as well, just to see what you are trying to do, as long as it is in English that is.

Regards

Mark
Well I am back a new PC I7 4790K, 780 TI, 16 Gigs, Windows 10. Hopefully will get delivered at weekend.

Computer Specs : I7 3770K, 780 TI, 16 Gigs, Win 10
HD Specs : 1 x 1 TB SSD + 4 x 8 TB = 33 TB (fullish)
First system : ZX81 (Yes I am an old fart)
PS Network : MarkNorvile
Xbox : Mark Norville

treme

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Change the background when changing systems
« Reply #2 on: March 30, 2022, 11:21:04 PM »
Thank you very much, I tried what you explained to me, but either I didn't place it where I should or it didn't work for me.
In the end I got it without placing the command you gave me, more or less I had it right, I just had to change something and it worked.

Now I will continue investigating how to put background music and place icons that move

Greetings

Mark Norville

  • Sr. Member
  • ****
  • Posts: 233
    • View Profile
Re: Change the background when changing systems
« Reply #3 on: March 31, 2022, 01:22:50 AM »
Yeah sorry, I did not post the full thing needed to get it up and running, it was just a snippet of what you need, and also just to make sure that your background or whatever images you have are named the same as your emulator or display.

The icons moving as just gif files I would believe.

Background music I believe that Kent's theme has BGM so take a look at his nutfile on how to add BGM. I personally do not use it as I have the sound of videos being played, so it is something that I have not even considered.

http://forum.attractmode.org/index.php?topic=3917.0

Regards

Mark
Well I am back a new PC I7 4790K, 780 TI, 16 Gigs, Windows 10. Hopefully will get delivered at weekend.

Computer Specs : I7 3770K, 780 TI, 16 Gigs, Win 10
HD Specs : 1 x 1 TB SSD + 4 x 8 TB = 33 TB (fullish)
First system : ZX81 (Yes I am an old fart)
PS Network : MarkNorvile
Xbox : Mark Norville

treme

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Change the background when changing systems
« Reply #4 on: March 31, 2022, 02:42:09 AM »
Thank you very much, the music thing in the main menu is more than anything because I have put images and there is only one image left, for the systems I usually use the sound of the video snaps.

I'll take a look at the link and Kent's theme.

Thanks

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: Change the background when changing systems
« Reply #5 on: April 08, 2022, 06:56:31 AM »
you can just use magic tokens,

local background = fe.add_image( "artwork/[DisplayName]", 0, 0, 1920 ,1080 );

"artwork" is refrencing a folder in your layout with images that are named the same as your display ie: nes.png

read the Layouts.txt file in the main folder, lots of good stuff...
help a friend....