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

What is Framer? Join the Community
Return to index
Jason Sparks
Posted Sep 15 - Read on Facebook

I'm using layers and textLayers drawn in the design tab like templates, then in code I'm creating multiple layers that copy the attributes of those templates in the design tab as follows:

slotTitle = new TextLayer
parent: slot
text: moviesData[i].details.title
fontSize: slotMovieTitleTemplate.fontSize
fontFamily: slotMovieTitleTemplate.fontFamily
fontWeight: slotMovieTitleTemplate.fontWeight
fontStyle: slotMovieTitleTemplate.fontStyle
textAlign: slotMovieTitleTemplate.textAlign
x: slotMovieTitleTemplate.x
y: slotMovieTitleTemplate.y
color: slotMovieTitleTemplate.color

Note: slotMovieTitleTemplate is the name of the layer in the design tab

Is there an easier way of duplicating the layer attributes rather than explicitly setting every one like I am doing above. I know there is the attribute but this just contains lots and lots of css styling.


George Kedenburg III

have you tried layer.copy() ?

Jason Sparks

Yeah, that'll do it, thanks, or layer.copySingle(). No idea why I didn't think of that!

Read the entire post on Facebook