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

What is Framer? Join the Community
Return to index
Michael Bing
Posted May 17 - Read on Facebook

Hi all

Can anybody tell me why i can't make this work?

test = new Layer
test.originX = 0.5
test.originX = 1
test.width = 200
test.center()

test.states.add
stateA: {width: 500}

test.states.animationOptions =
curve: "spring(400, 55, 0)"

test.on Events.Click, ->
test.states.next()

I want the box to scale from the center, but it wont work. It works with rotation etc..... but not scale. Am i doing something wrong here?

8 Comments

Jordan Robert Dobson

Why do you set origins twice?

Jordan Robert Dobson

Do you want to scale it or make it wider?

Michael Bing

Yeah, i want to make it scale, but with a fixed size, and from the center.

Michael Bing

Weird thing is, it works on rotation, but not with scaling a width?

Jordan Robert Dobson

Yep. If you use width you also have to change the xPos negatively half the distance you're scaling up.

Michael Bing

I know i can use the scale, but that is what i dont want. I want to have a fixed with ex. 500, so it should scale from the center of 500.

Jordan Robert Dobson

I gave you the answer.

Benjamin Den Boer

Here's a little example of animating the width and height to grow a layer from its center point, Michael Bing - in case you didn't catch this yet. :-) http://share.framerjs.com/ylfduegh773h/

Read the entire post on Facebook