Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: 8bitsdeep on January 29, 2017, 02:16:43 AM
-
I'm making my first layout and I'm almost done, just one major hurdle remains. I'd like the layout to display the boxart centered in the empty area on the right. (see image). Problem is, depending on the console, the box will have wildly different dimensions. NES vs SNES for example is tall rectangles vs wide ones.
I'd rather avoid stretching artwork into a pre-defined box, for obvious reasons. Has anyone come up with a good way to handle this sort of thing?
-
set the artwork aspect as TRUE
and define maximum horizontal and vertical size of your artwork - it's like setting the boundaries for your artwork, it can't be higher than defined vertical size, and it can't be wider than defined horizontal size.
It will work like "scale to fit" option for printing - it will show your artwork (without stretching) in maximum size that fits within defined boundaries.
-
Works great, thank you!
-
Having the same problem...
Could you elaborate how to do it, please? I'm using this...
if ( my_config["enable_gboxart"] == "Yes" )
{
local boxart = fe.add_artwork("boxart", flx*0.0, fly*0.45 flw*0.3, flh*0.3 );
if ( my_config["ratio"] == "Yes" )
{
boxart.preserve_aspect_ratio = true;
}
}
but as you can see it streches the box...
(http://i.imgur.com/pzyCJRp.jpg)
how can i set the maximum size of the artwork? ???
-
i would like to also know?
-
Ok, i think i get it... You need this
local my_config = fe.get_config();
local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;
then this for the boxart
if ( my_config["enable_gboxart"] == "Yes" )
{
local boxart = fe.add_artwork("boxart", flx*0.0, fly*0.45 flw*0.3, flh*0.3 );
boxart.preserve_aspect_ratio = true;
}
I had width and height set as 640x480 and it was doing some funny effects... With some 3d artworks it's still not perfect, but it seems to work with a lot of them.
-
shouldn't it be:
fe.add_artwork("boxart", flx*0.0, fly*0.45, flw*0.3, flh*0.3 );
Looks like you're missing a common between the Y and W dimensions.
fe.add_artwork( "boxart",x, y, w, h );