Is there a way that my BLUE layers inside of my GREEN scroll component have a position x and y not relative to the scroll component itself ?
Basically I would want to have the x of my blue layer be 550 ish instead of 10.
I tried to change the superlayers but if the scroll component and the layers didn't have the same superlayers, it doesn't work or maybe I did something wrong.
Thanks for your help :)
Hi Robin, the x and y position of a layer are always relative to the layer that contains it (the parent or superLayer). You can still calculate the numbers you want by adding the x of the parent(s) to the x of the layer.
Here’s a small example project that contains a function for calculating the ‘absolute’ position of a layer.
Thank you so much man ! This is really helpful !!
When I'm changing the position the layer is moving which is normal. Do you have a trick in mind to make the absolute position the regular position but without making the layer move ?
Yeah, you can basically use the same function and then use some handy (but undocumented) geometry utilities to calculate the relative position.
Here’s an updated project, click on the right layer to update its position: http://share.framerjs.com/bpd8xk5ghmew/
Thank you again Eelco Lempsink !!