2017-02-19 26 views
0

我只想做一个快速的原型下面这个教程:层甚至给它分配的内容后是空的

https://www.youtube.com/watch?v=3zaxrXK7Nac

我用我自己的这个设计,这个问题如下:

当我创建一个新图层time 8:13 of the posted video,并尝试使用属性image将我的一个导入图层设置为此新图层的内容时,我无法获得任何结果。

如果我将这个新图层带到屏幕上,根据教程我只能看到具有透明度的黑色背景,它应该有我通过图像属性分配给它的图层。

这里是我的代码示例:

sketch = Framer.Importer.load("imported/[email protected]") 

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

回答

0

成帧器将始终导入组草图的选择页面,该页面上的所有组将转换为直接在草图对象上可用的图层。 另外:您现在将图层的图像设置为图层对象本身,而不是草图图层。

因此,要得到它的工作,你需要做两件事情:

  1. 将所有的要素要在素描
  2. 在同一个页面上使用导入后,访问这些元素直接从草图对象(因此sketch.explore_group而不是sketch.explore.explore_group
  3. 使用草图图层的图像,或在原型中使用草图图层本身。

下面是一个例子,将如何看它:

sketch = Framer.Importer.load("imported/[email protected]") 

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)" 

甚至更​​短,并与updated animation syntax

sketch = Framer.Importer.load("imported/[email protected]") 

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) 
+0

非常感谢您的帮助! – user2634544

相关问题