2017-02-19 45 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

相關問題