Author Topic: flyer/boxart sizing  (Read 10732 times)

InsecureSpike

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
flyer/boxart sizing
« on: April 29, 2016, 10:00:15 AM »
hi guy's, i'm hoping someone will be able to help me out a little,
i'm running on a Rpi 2b

i'm trying to use snes boxart at this size 475 × 347 but i just can't get them to show top sharp
i've been using this lil bit of code..

Code: [Select]
// Flyer
local surface = fe.add_surface( 430, 564 );
local artwork = FadeArt( "flyer", 0, 0, 430, 564, surface );
artwork.trigger = TRIGGER;
artwork.preserve_aspect_ratio = true;
surface.set_pos( 110, 124, 430, 564 );

i have this issue with all my art, i i can just know where to put the right dimensions i should be good to go with doing other systems

thank you

Floob

  • Full Member
  • ***
  • Posts: 84
    • View Profile
Re: flyer/boxart sizing
« Reply #1 on: May 02, 2016, 03:59:43 PM »
What do you mean when you say "top sharp"

I'm just checking this out:
https://github.com/mickelson/attract/blob/v2.0.0/Layouts.md

What happens if this is:
surface.set_pos( 0, 0, 430, 564 );
RetroPie Help Guides: https://goo.gl/3gcNsT

InsecureSpike

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: flyer/boxart sizing
« Reply #2 on: May 05, 2016, 09:00:48 AM »
lol, it throws me out to commandline when i move to the layout i add/change those bits of code....

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: flyer/boxart sizing
« Reply #3 on: May 05, 2016, 06:57:45 PM »
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);

InsecureSpike

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: flyer/boxart sizing
« Reply #4 on: May 06, 2016, 11:46:46 AM »
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);

thank you lots!

local surface = fe.add_surface( 430, 564 );
local artwork = surface.add_artwork("flyer",  0, 0, 430, 564);

has worked a treat!

many thanks

InsecureSpike

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: flyer/boxart sizing
« Reply #5 on: May 19, 2016, 05:58:08 AM »
ok, I'm back for some more advice & help

is there anyway i can create this type of image/artwork input to attract mode.
these are what i use in my EmulationStation themes

      <image name="md_image">
         <pos>0.25 0.56</pos>
<!--          <size>0.135 0.301</size>
 -->         <maxSize>0.500 0.500</maxSize>
         <origin>0.5 0.5</origin>
      </image>

as you can see, there are no actual image/artwork sizes, just a maximum width & height.
with this the image/artwork is scaled down keeping the resolution.

i'm still having problems with scaling boxart for many systems, even when i batch size all of these high quality images, down to 500 max width or height, which ever is the greater.
i'm having boxart that has jagged diagonal and curved artwork
« Last Edit: May 19, 2016, 06:07:15 AM by InsecureSpike »

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: flyer/boxart sizing
« Reply #6 on: May 20, 2016, 06:03:52 PM »
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 );

InsecureSpike

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: flyer/boxart sizing
« Reply #7 on: May 21, 2016, 12:42:51 AM »
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 );

awesome, thank you, i'll have a play over the next few days

InsecureSpike

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: flyer/boxart sizing
« Reply #8 on: May 23, 2016, 12:13:00 PM »
ok, i feel a little silly, but, i'm pleased to say, i've fixed the poor quality boxart etc, i had the screen size set in 720p!
now I've set it to

local flx = fe.layout.width;
local fly = fe.layout.height;
local flw = fe.layout.width;
local flh = fe.layout.height;


alls cool!
just need to figure out if its possible to position the image to left-centre instead id top-left corner as the origin point of the art, so as the layout can be used for multiple systems and not a fixed bot art size..

but i'm making progress, and i'll post a WiP over the next few days,

thank you for all your help, @omegaman

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: flyer/boxart sizing
« Reply #9 on: May 23, 2016, 07:51:07 PM »
Spike-

This should help. Here's a brief explanation on how coordinates work.   

fe.add_image( name, x, y, w, h )

The x axis starts from left to right, and the y axis from top to bottom, meaning the starting point would be 0,0 at the top left corner.

For example, coordinates for this image "( "fubar.png", 100, 150, 300, 250 )"  translates into move right 100 pixel units, move down 150 units, 300 units wide and 250 in units height.

Anyway, this is typically the way you would use 2D coordinates to position an image in your layout.

For scaling, the coordinates would be entered in this way "( "fubar.png", flx*0.1, fly*0.15, flw*0.3, flh*0.25)". Just keep in mind that your dealing with small increments.