Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: jretropie on November 01, 2016, 09:51:31 AM

Title: What is flx, fly, flh, flw?
Post by: jretropie on November 01, 2016, 09:51:31 AM
What is flx, fly, flh, flw?

Can it be convert to pixel?
Title: Re: What is flx, fly, flh, flw?
Post by: keilmillerjr on November 01, 2016, 01:55:56 PM
Looks like variables some one created for a layout.
Title: Re: What is flx, fly, flh, flw?
Post by: verion on November 01, 2016, 04:37:16 PM
there are two variables
fe.layout.width - layout width in pixels
and
fe.layout.height - layout height in pixels


if you leave it undefined
fe.layout.width will be your screen X resolution (like 1920px) and fe.layout.height will be your screen Y resolution (like 1080px)

flh and flw - are usually used as a shorter version - so you don't have to type in code "fe.layout.width" all the time - just "flw"
but you have to define it first as variable
flw = fe.layout.width

---

So - if you want to use fixed dimensions in pixels - you should first define fe.layout.width and fe.layout.height in pixels.
Because if you don't - you'll end up with fixed dimensions and position of your layout elements and variable size of a whole layout.
Keep in mind that AM stretches your layout (by default) to fit the screen.

So if you use
fe.layout.width=640
fe.layout.height=480
it will look as intended (full screen) on 1024x768 or 800x600 res screen - but it will be stretched horizontally on 1920x1080 screen

Title: Re: What is flx, fly, flh, flw?
Post by: jretropie on November 02, 2016, 06:24:37 AM
I was trying to modify a theme. 

It has the following line to add video snap position:
surface.set_pos(flx*0.083, fly*0.30, flw*0.35, flh*0.35);

How do I convert these 0.083, 0.30....etc  to pixel so I don't have to go back and forward and look at the actual screen?


there are two variables
fe.layout.width - layout width in pixels
and
fe.layout.height - layout height in pixels


if you leave it undefined
fe.layout.width will be your screen X resolution (like 1920px) and fe.layout.height will be your screen Y resolution (like 1080px)

flh and flw - are usually used as a shorter version - so you don't have to type in code "fe.layout.width" all the time - just "flw"
but you have to define it first as variable
flw = fe.layout.width

---

So - if you want to use fixed dimensions in pixels - you should first define fe.layout.width and fe.layout.height in pixels.
Because if you don't - you'll end up with fixed dimensions and position of your layout elements and variable size of a whole layout.
Keep in mind that AM stretches your layout (by default) to fit the screen.

So if you use
fe.layout.width=640
fe.layout.height=480
it will look as intended (full screen) on 1024x768 or 800x600 res screen - but it will be stretched horizontally on 1920x1080 screen
Title: Re: What is flx, fly, flh, flw?
Post by: verion on November 03, 2016, 12:00:42 AM
flx=flw=screen width in pixels
fly=flh=screen height in pixels

so if you are coding for fixed resolution like 1024x768 it will be:

surface.set_pos(1024*0.083, 768*0.30, 1024*0.35, 768*0.35);

so the first value will be 1024*0.083 = 85px
Title: Re: What is flx, fly, flh, flw?
Post by: gionni44 on March 06, 2018, 06:01:08 AM
there are two variables
fe.layout.width - layout width in pixels
and
fe.layout.height - layout height in pixels


if you leave it undefined
fe.layout.width will be your screen X resolution (like 1920px) and fe.layout.height will be your screen Y resolution (like 1080px)

flh and flw - are usually used as a shorter version - so you don't have to type in code "fe.layout.width" all the time - just "flw"
but you have to define it first as variable
flw = fe.layout.width

---

So - if you want to use fixed dimensions in pixels - you should first define fe.layout.width and fe.layout.height in pixels.
Because if you don't - you'll end up with fixed dimensions and position of your layout elements and variable size of a whole layout.
Keep in mind that AM stretches your layout (by default) to fit the screen.

So if you use
fe.layout.width=640
fe.layout.height=480
it will look as intended (full screen) on 1024x768 or 800x600 res screen - but it will be stretched horizontally on 1920x1080 screen

And how to create a variable with dimensions of an artwork?
fe.layout.width  -->  the monitor width
fe.image????  I would like to create a border around an artwork but each art has its width
Title: Re: What is flx, fly, flh, flw?
Post by: zpaolo11x on March 06, 2018, 08:22:41 AM
And how to create a variable with dimensions of an artwork?
fe.layout.width  -->  the monitor width
fe.image????  I would like to create a border around an artwork but each art has its width

fe.layout.width is the canvas dimension, while ScreenWidth and ScreenHeight are constants you can use to get the actual screen resolution.

That said, image.width and image.height are the width and height of an artwork on screen.
Title: Re: What is flx, fly, flh, flw?
Post by: gionni44 on March 08, 2018, 02:50:44 AM
And how to create a variable with dimensions of an artwork?
fe.layout.width  -->  the monitor width
fe.image????  I would like to create a border around an artwork but each art has its width

fe.layout.width is the canvas dimension, while ScreenWidth and ScreenHeight are constants you can use to get the actual screen resolution.

That said, image.width and image.height are the width and height of an artwork on screen.

Ok understood, but I have many artworks, how to assign image.width to boxart for example?

local fbw = fe.image.width.boxart ?

local fbw = fe.image.boxart.width ?

thanks!