Author Topic: Keep the correct aspect ratio of vertical snapshots  (Read 771 times)

Elaphe666

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Keep the correct aspect ratio of vertical snapshots
« on: October 27, 2024, 11:16:39 AM »
I have a layout which shows the snapshot of the selected game. It scales the original artworks (which have different dimensions) to a fixed size of 640x480. So far so good. The problem is with vertical games, as these images get very distorted. My idea is that vertical snapshots are displayed on the same area, keeping the 480 pixels high, but at 360 pixels wide to keep the right proportions. Could you please provide an example of the code? Thank you.

Elaphe666

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Keep the correct aspect ratio of vertical snapshots
« Reply #1 on: October 28, 2024, 10:01:44 AM »
OK. I made if by copying code from other layouts:

local snap = fe.add_artwork( "snap", 1250, 26, 640, 480 );
snap.preserve_aspect_ratio = true;
local title = fe.add_artwork( "marquee", 1250, 570, 640, 480 );
title.preserve_aspect_ratio = true;