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

What is Framer? Join the Community
Return to index
Elias Suske
Posted Feb 01 - Read on Facebook

Hi everbody,

i have two questions, where I didn't found any solution yet:

1) I want to rotate an object via rotationZ, but i want that the sublayers to stay in its original Z-rotation (imagin a circular menu und the text lables should always face the user). Is there an function for that (something like worldRotation …)?

2) I set up an Arduino with an encoder, and i want to stir my FramerStudio-prototype with it. How is this communication possible? Any library? Did anybody make something similar?

Thanks in advance!
Cheers

7 Comments

Sigurd Tapio Mannsåker

I doubt that there's a built in way to rotate an element without rotating its sublayers, although I may be mistaken. I suppose you could just rotate the sublayers in the opposite direction, either in the same function that rotates the menu or via menu.on "change:rotation"?

Andrew Nalband

The main point of creating a sublayer is to associate it's movements with the parent layer. I would just recommend decoupling them in this case.

Sigurd Tapio Mannsåker

Yup, but if it literally is multiple text labels around a circle, and they need to stay straight while the circle as a whole rotates, rotating them in the opposite way is probably the quickest way to hack it. Either that or get your trigonometry on to animate them in a circle :)

Jonas Treub

The next version of FramerJS will have a new originZ property which will make this way easier. If you try the beta you can already play around with this property.

Elias Suske

Ok thank you guys. I did the hack, its working … good to know that there will be originZ in the future :)

What about the Arduino? Any ideas?

Jonas Treub

Arduinos have software to map inputs to keyboard keys which you can listen for. Never tried it myself but Tom Goijer knows how to do that.

Callil Capuozzo

Elias Suske one simple way to use the Arduino is to have it emulate key strokes, I've used this and it works really well. The Arduino can act like a HID and you can map the turn of the pot to something like wasd (left,right,up,down).

After that all you need to do is listen for the key to be pressed and you can use it like a regular event.

Read the entire post on Facebook