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

What is Framer? Join the Community
Return to index
Jason Lang
Posted Jun 26 - Read on Facebook

I've got a superLayer that contains several subLayers. Is there a way that I can force subLayer's X any Y positions to be relative to the superLayer, and not the overall canvas?

I'm looking for a simple/logical way to arrange all my subLayers. Then I can just animated my superLayer.

9 Comments

Balraj Chana

You can simply assign a superLayer to a subLayer like this: http://share.framerjs.com/4wf4tv06rkaf/

http://framerjs.com/docs/#layer.superLayer

Chris Camargo

Jason, subLayers X and Y positions *are* relative to the superLayer. Are you finding otherwise?

Jason Lang

Balraj's file exposed my issue. It's working now.

Jason Lang

It actually just exposed another issue — can the subLayers change the height of the superLayer?

Chris Camargo

Layers don't resize based on their contents. You'd have to tell the superLayer to resize, yourself.

Jason Lang

Chris, thats what it looks like. essentially I'm trying to build an accordion layout with several superLayers that expand and contract based on some animations that happen on the subLayers.

Chris Camargo

This is slightly tangential, but if you're looking to measure the size of some text as it is rendered, check out the Utils.textSize function (still a bit experimental, I believe). That could help you get a bit more dynamic with your sizing if you're using text heavy layouts.

Chris Camargo

A quick search in the group reveals some info on it: https://www.facebook.com/groups/framerjs/search/?query=Utils.textSize

Jason Lang

Ok prefect. Yea I'm spec'ing out some interactions with messaging app timeline. Text inside a bunch of views, and each view shows additional info above and below when tapped. Hence the accordion layout. This looks useful.

Read the entire post on Facebook