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

What is Framer? Join the Community
Return to index
Elliott Malkin
Posted Jan 29 - Read on Facebook

I'm stuck. Again. I have imported a few layers from Sketch, an artboard called "artboard" containging a group with an image called "background". The absolute size of this background is 2000x1500. After successfully centering the artboard, I then want to scale it to the screen size of whatever device this is viewed within. But this scaling is not working, even when I use "sketch.background.width = Screen.width" instead.

3 Comments

Amrit Mazumder

try this?

Elliott Malkin

I actually need to take this one step further. I want this background to scale every time I resize the Framer window on my desktop. I'm trying to use "Canvas.on "change:size", ->" to catch this event. But it's not catching the event.

Randi Dumaguet

Is it possible to just use CSS for the background? From the top of my head:

bg = new Layer
bg.image = "path/to/image.ext"

I'm on my phone right now so can't check the code but if I remember the docs correctly, the image is supposed to fit the screen when you resize. Otherwise, add a css property background-size: cover

Read the entire post on Facebook