Commit 4b8061d6fd92468282711df0425ce35123c97a2f

Authored by Ferran Sole
1 parent 22be2768

Added path animation example in animation.json script for verification

Change-Id: I0448b0d1d794aa7c1e9760da4cf48914651a07c3
Showing 1 changed file with 35 additions and 0 deletions
demo/scripts/animation.json
... ... @@ -24,6 +24,14 @@
24 24 "parent-origin": "CENTER"
25 25 }
26 26 },
  27 + "paths":
  28 + {
  29 + "path0":
  30 + {
  31 + "points":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],
  32 + "curvature":0.35
  33 + }
  34 + },
27 35 // library of animations
28 36 "animations": {
29 37 "animate": {
... ... @@ -59,6 +67,19 @@
59 67 "duration": 3
60 68 }
61 69 }]
  70 + },
  71 + "path-animation": {
  72 + "duration": 3.0,
  73 + "properties": [{
  74 + "actor": "greeting2", // referenced actors must exist on stage
  75 + "path":"path0",
  76 + "forward":[1,0,0],
  77 + "alpha-function": "EASE_IN_OUT",
  78 + "time-period": {
  79 + "delay": 0,
  80 + "duration": 3
  81 + }
  82 + }]
62 83 }
63 84 },
64 85 // a tree of actors
... ... @@ -76,6 +97,20 @@
76 97 "animation": "animate"
77 98 }]
78 99 }, {
  100 + "name":"greeting2",
  101 + "type": "TextView",
  102 + "parent-origin": "CENTER",
  103 + "anchor-point": "CENTER",
  104 + "size": [200, 200, 1],
  105 + "rotation": [0, 0, 39],
  106 + "position": [-150, -50, 0],
  107 + "text": "or me",
  108 + "signals": [{
  109 + "name": "touched",
  110 + "action": "play",
  111 + "animation": "path-animation"
  112 + }]
  113 + }, {
79 114 "type": "TextView", // styles can be additive
80 115 "parent-origin": "CENTER",
81 116 "anchor-point": "CENTER",
... ...