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

What is Framer? Join the Community
Return to index
Jacek Stryk
Posted Oct 26 - Read on Facebook

How can I set only one attribute of a layerA.screenFrame, example just want to set the Y value i.e. layerA.screenFrame.y = 100

I tried different things and could not figure it out. I can do "print layerA.screenFrame.y" and it prints only the Y coordinate yet layerA.screenFrame.y = 100 does not changes the layerA y coordinates.

I can do layerA.screenFrame =
x: 200
y: 100
width: whatever
size: whatever

but I just want to adjust the Y attribute of layerA not everything.


Sigurd Tapio Mannsåker

Lodash has a handy extend method, which comes with Framer. So _.extend layerA.screenFrame, { y: 100 }

Sigurd Tapio Mannsåker

As in set the screenFrame property to that. On my phone but here's a screen grab of two functions I've added to the Layer class in my personal handy helper module, saves some code if you do it a lot.

Jacek Stryk

Thanks Sigurd Tapio Mannsåker, exactly what I was looking for! :)

Jacek Stryk

Sigurd Tapio Mannsåker so I tried to use your class extension but cannot figure how to make it work. I added the code from the helper class and try to do things like layer.ScreenY = aValue etc but that does not adjust any of the layer Y position. What am I doing wrong? See code below

Read the entire post on Facebook