Bladeren bron

Updated example with new graphics

Björn Ritzl 5 maanden geleden
bovenliggende
commit
d0f18fff9d

BIN
animation/chained_tween/assets/images/bunny2_ready.png


BIN
animation/chained_tween/assets/images/shipBlue_manned.png


+ 1 - 1
animation/chained_tween/assets/sprites.atlas

@@ -1,4 +1,4 @@
 images {
-  image: "/assets/images/bunny2_ready.png"
+  image: "/assets/images/shipBlue_manned.png"
 }
 extrude_borders: 2

+ 1 - 1
animation/chained_tween/example.md

@@ -2,7 +2,7 @@
 tags: animation
 title: Tween animations chain
 brief: This example shows how to chain two tween animations of the position of a game object. In addition, the scale and tint is animated separately.
-scripts: bunny.script
+scripts: spaceship.script
 ---
 
 ![tween](chained_tween.png)

+ 7 - 39
animation/chained_tween/example/chained_tween.collection

@@ -1,57 +1,25 @@
 name: "default"
 scale_along_z: 0
 embedded_instances {
-  id: "bunny"
+  id: "spaceship"
   data: "components {\n"
   "  id: \"script\"\n"
-  "  component: \"/example/bunny.script\"\n"
-  "  position {\n"
-  "    x: 0.0\n"
-  "    y: 0.0\n"
-  "    z: 0.0\n"
-  "  }\n"
-  "  rotation {\n"
-  "    x: 0.0\n"
-  "    y: 0.0\n"
-  "    z: 0.0\n"
-  "    w: 1.0\n"
-  "  }\n"
+  "  component: \"/example/spaceship.script\"\n"
   "}\n"
   "embedded_components {\n"
   "  id: \"sprite\"\n"
   "  type: \"sprite\"\n"
-  "  data: \"tile_set: \\\"/assets/sprites.atlas\\\"\\n"
-  "default_animation: \\\"bunny2_ready\\\"\\n"
+  "  data: \"default_animation: \\\"shipBlue_manned\\\"\\n"
   "material: \\\"/builtins/materials/sprite.material\\\"\\n"
-  "blend_mode: BLEND_MODE_ALPHA\\n"
+  "textures {\\n"
+  "  sampler: \\\"texture_sampler\\\"\\n"
+  "  texture: \\\"/assets/sprites.atlas\\\"\\n"
+  "}\\n"
   "\"\n"
-  "  position {\n"
-  "    x: 0.0\n"
-  "    y: 0.0\n"
-  "    z: 0.0\n"
-  "  }\n"
-  "  rotation {\n"
-  "    x: 0.0\n"
-  "    y: 0.0\n"
-  "    z: 0.0\n"
-  "    w: 1.0\n"
-  "  }\n"
   "}\n"
   ""
   position {
     x: 60.0
     y: 96.0
-    z: 0.0
-  }
-  rotation {
-    x: 0.0
-    y: 0.0
-    z: 0.0
-    w: 1.0
-  }
-  scale3 {
-    x: 1.0
-    y: 1.0
-    z: 1.0
   }
 }

BIN
animation/chained_tween/example/chained_tween.png


+ 4 - 4
animation/chained_tween/example/bunny.script → animation/chained_tween/example/spaceship.script

@@ -1,16 +1,16 @@
 local up_down -- <1>
 local left_right
-	
+
 function up_down(self) -- <2>
-	go.animate(".", "position.y", go.PLAYBACK_ONCE_PINGPONG, 624, go.EASING_INOUTSINE, 2, 0, left_right)
+    go.animate(".", "position.y", go.PLAYBACK_ONCE_PINGPONG, 624, go.EASING_INOUTSINE, 2, 0, left_right)
 end
 
 function left_right(self) -- <3>
-	go.animate(".", "position.x", go.PLAYBACK_ONCE_PINGPONG, 660, go.EASING_INOUTSINE, 2, 0, up_down)	
+    go.animate(".", "position.x", go.PLAYBACK_ONCE_PINGPONG, 660, go.EASING_INOUTSINE, 2, 0, up_down)	
 end
 
 function init(self)
-	up_down(self) -- <4>
+    up_down(self) -- <4>
     go.animate(".", "scale.y", go.PLAYBACK_LOOP_PINGPONG, 0.5, go.EASING_INOUTSINE, 1) -- <5>
     go.animate("#sprite", "tint.x", go.PLAYBACK_LOOP_PINGPONG, 0.0, go.EASING_INOUTSINE, 1.5) -- <6>
 end

+ 1 - 1
render/camera/example.md

@@ -1,7 +1,7 @@
 ---
 tags: render
 title: Camera
-brief: This example shows how to use use a camera component and have it follow a game object. Click to toggle between following the game object and staying stationary.
+brief: This example shows how to use a camera component and have it follow a game object. Click to toggle between following the game object and staying stationary.
 scripts: bee.script, camera.script
 ---