我只是试着按照这个教程做一个快速原型:
https://www.youtube.com/watch?v=3zaxrXK7Nac
我正在使用我自己的设计,问题如下:
当我创建time 8:13 of the posted video的新图层time 8:13 of the posted video ,我试图通过使用属性image将我的一个导入图层设置为此新图层的内容,但没有任何结果。
如果我将这个新图层带到屏幕上,根据教程,我只能看到具有透明度的黑色背景,它应该有我通过图像属性分配给它的图层。
这是我的代码的一个例子:
sketch = Framer.Importer.load("imported/Untitled@2x") explore_layer = new Layer width: 750 height: 1334 image: sketch.explore.explore_group x: screen.width sketch.Tab_3.on Events.Click, -> explore_layer.animate properties: x: 0 y: 0 curve: "spring(400, 35, 0)"这里也是我的图层的截图
https://gyazo.com/f3fccf7f38813744ea17d259463fabdc
I just trying to do a quick prototype following this tutorial:
https://www.youtube.com/watch?v=3zaxrXK7Nac
I'm using my own design for this, the problem is as follows:
When I create a new layer time 8:13 of the posted video and I try to set one of my imported layers as the content of this new layer by using the property image, I get no results.
If I bring this new layer to the screen I can only see black background with transparency, according to the tutorial, it should has the layer I'm assign to it via the image property.
Here is an example of my code:
sketch = Framer.Importer.load("imported/Untitled@2x") explore_layer = new Layer width: 750 height: 1334 image: sketch.explore.explore_group x: screen.width sketch.Tab_3.on Events.Click, -> explore_layer.animate properties: x: 0 y: 0 curve: "spring(400, 35, 0)"Here is also a screenshot of my layers
https://gyazo.com/f3fccf7f38813744ea17d259463fabdc
最满意答案
Framer将始终将所选组中的所有组导入Sketch中,并且该页面上的所有组将转换为直接在草图对象上可用的图层。 另外:您现在将图层的图像设置为图层对象本身,而不是草图图层。
所以为了使它起作用,你需要做几件事情:
在Sketch中将所有要使用的元素放在同一页面上 导入后,直接从草图对象访问这些元素(如sketch.explore_group而不是sketch.explore.explore_group ) 使用草图图层的图像,或在原型中使用草图图层本身。下面是一个例子:
sketch = Framer.Importer.load("imported/Untitled@2x") explore_layer = new Layer width: 750 height: 1334 image: sketch.explore_group.image x: screen.width sketch.Tab_3.on Events.Click, -> explore_layer.animate properties: x: 0 y: 0 curve: "spring(400, 35, 0)"甚至更短,并使用更新的动画语法 :
sketch = Framer.Importer.load("imported/Untitled@2x") sketch.explore_group.x = screen.width sketch.Tab_3.on Events.Click, -> sketch.explore_group.animate x: 0 y: 0 options: curve: Spring(tension:400, friction:35)Framer will always import the groups in the selected page of Sketch, and all the groups on that page will transformed into layers that are available on the sketch object directly. Also: you're now setting the image of a layer to a layer object itself, instead of the image of the sketch layer.
So to get it to work, you need to do a couple of things:
Place all the elements that you want to use on the same page in Sketch After importing, access those elements directly from the sketch object (so sketch.explore_group instead of sketch.explore.explore_group) Use the image of the sketch layer, or use the sketch layer itself in your prototype.Here's an example how it that would look:
sketch = Framer.Importer.load("imported/Untitled@2x") explore_layer = new Layer width: 750 height: 1334 image: sketch.explore_group.image x: screen.width sketch.Tab_3.on Events.Click, -> explore_layer.animate properties: x: 0 y: 0 curve: "spring(400, 35, 0)"Or even shorter, and with an updated animation syntax:
sketch = Framer.Importer.load("imported/Untitled@2x") sketch.explore_group.x = screen.width sketch.Tab_3.on Events.Click, -> sketch.explore_group.animate x: 0 y: 0 options: curve: Spring(tension:400, friction:35)更多推荐
发布评论