This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Adam Laskowitz
Posted Jul 27 - Read on Facebook

Hey everyone. New to framer. Super excited to make it part of my core toolset. Quick question, is there a way to define width and height of a layer by the "screen" width and height?

7 Comments

Koen Bok

I added some experimental helpers for that a week ago:

layer = new Layer width:Screen.width, height:Screen.height

or use a background layer

layer = new BackgroundLayer backgroundColor:"green"

Adam Laskowitz

Thanks Koen! Where are those helpers located?

Koen Bok

You can just use them right away.

Lorenzo Fernix Ferrante

And there is a way to define width or height of a layer to 50% for example?
Thanks

Koen Bok

That would just be your own formula. So myLayer.width = Screen.width / 2

Lorenzo Fernix Ferrante

Thanks dude!

Koen Bok

Keep in mind that if the width is an uneven number, you want to round the value to avoid it drawing at a .5 pixel which makes everything blurry.

myLayer.width = parseInt(Screen.width / 2)

Read the entire post on Facebook