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

What is Framer? Join the Community
Return to index
Taylor Wright
Posted Dec 20 - Read on Facebook

Is there a name for the stage / root / base layer? I come from a Flash background, so I'm used to having a stage / root to build from but I didn't see anything like that in Framer. For example, if I wanted to move a nested layer to the root I can't put "foo.superLayer = root" I have to use "foo.superLayer = null" (what layer is null?).
I ask because I wanted to add a touchMove listener to the Stage to get around some weirdness I'm getting with it elsewhere, but realized I had no language to describe <Window {}>.

5 Comments

Cameron Luck

You can try utilizing the Framer.Device class: http://framerjs.com/docs/#device.device. More specifically, I think Framer.Device.screen will do what you want.

To do something with a touch event, I'd suggest making a Layer with the width as Screen.width and height as Screen.height and then using this new Layer as the super layer for the other items.

Taylor Wright

It looks like that's what I'll need to do. I was hoping I could take advantage of the BackgroundLayer I was already but it seems like its size is locked to 100x100 even though it displays as filling the screen size..

Cameron Luck

I just put together a little demo of a box that follows the mouse (somewhat) based on the Framer.Device layer here: http://share.framerjs.com/q7plxaeixuso/

Let me know if this helps!

Andrew Nalband

Cameron Luck, I would use Jordan Robert Dobson's pointer module for that http://share.framerjs.com/t67xquf4fz11/

Drew Stock

In Coffeescript, variable declarations are locally scoped by default. If you want scope something globally, you can refer to 'root' like so:

root = exports ? this
root.myVar = "some string"

Read the entire post on Facebook