1
Scripting / Re: Retropie gamelist to attract-mode converter
« on: June 15, 2017, 03:34:46 AM »
awesome!ill try this out one the next few days, thanks
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
fe.load_module( "animate" );
Game info scraping was added to AM in November but it doesn't use the "Extras" field of the romlist. It creates a folder for the emulator name and places gamename.txt file in there to match the game names. You can see it here https://github.com/mickelson/attract/commit/540ffb6ad022bb59a519a8f01b9926fb4900b941.
You need to manually enable it in the attract.cfg when AM is NOT running.Code: [Select]scrape_overview yes
Then start AM and build the romlist to get the files.
local textoverview =fe.add_text("[Overview]", 860, 440, 400, 200)
textoverview.charsize = 16;
textoverview.set_rgb( 166, 166, 166 );
textoverview.align = Align.Left;
textoverview.word_wrap = true;
textoverview.alpha = 0;
//textoverview.style = Style.Bold;
local textoverview =fe.add_text("[Overview]", 860, 440, 400, 200)
textoverview.charsize = 16;
textoverview.align = Align.Left;
textoverview.word_wrap = true;
textoverview.alpha = 0;
//textoverview.style = Style.Bold;
local textoverview_alpha_cfg_on_load = {
when = When.StartLayout,
when = Transition.ToNewList,
property = "alpha",
start = 0,
end = 255,
delay = 1500
time = 1000
}
animation.add( PropertyAnimation( textoverview, textoverview_alpha_cfg_on_load ) );
local textoverviewx = {
when = When.StartLayout,
property = "x",
start = flx*1.2
end = flx*0.705
time = 1000,
tween = Tween.Expo
}
animation.add( PropertyAnimation ( textoverview, textoverviewx ) );
local textoverviewy = {
when = When.StartLayout,
property = "y",
start = fly*0.9
end = fly*0.1
time = velTexto,
tween = Tween.Linear
delay = 2000
loop = true
}
animation.add( PropertyAnimation ( textoverview, textoverviewy ) );
local l = fe.add_listbox( 630, 110, 570, 530 );
l.rows = 26;
l.charsize = 24;
l.selbg_alpha = 0;
l.set_selbg_rgb( 0, 0, 0 );
l.set_rgb( 166, 166, 166 );
l.set_sel_rgb( 255, 0, 0 );
l.align = Align.Left;
l.sel_style = Style.Regular;
Spike-
No, not without a function to parse the data into something squirrel understands, but I could just be talking out of my arse.
Instead, you can have your art auto scale or fill to the desktop resolution. So, if I want my layouts to scale up to most 4:3 & 16:9 resolutions, I would do this. There is another method as well but you would need to specify every possible aspect ratio. But, I'm too lazy for that.
Notice, that I did not specify a resolution in the .nut example. That's because I want all the objects to scale with the desktop.
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;
//create surface for snap
local surface = fe.add_surface( 640, 480 );
local snap = surface.add_artwork("snap", 0, 0, 640, 480);
snap.trigger = Transition.EndNavigation;
snap.preserve_aspect_ratio = false;
//now position the surface
surface.set_pos(flx*0.092, fly*0.38, flw*0.135, flh*0.135);
more examples, etc.
local marquee = fe.add_artwork("marquee", flx*0.117, fly*0.086, flw*0.35, flh*0.14 );
Trying doing your surface like this;
local surface = fe.add_surface( 430, 564 );
local artwork = surface.add_artwork("flyer", 0, 0, 430, 564);
or
local artwork = surface.FadeArt("flyer", 0, 0, 430, 564);