Browse Source

Updated 2D/3D templates with default camera and added 2D static sprite component

Lara Engebretson 9 years ago
parent
commit
5e2595eafa

+ 16 - 0
Data/AtomicEditor/ProjectTemplates/Project2D/JavaScript/Resources/Components/Spinner.js

@@ -0,0 +1,16 @@
+"atomic component";
+//inspector fields to make speed variable visible in editor
+var inspectorFields = {
+    speed: 1.0
+}
+
+exports.component = function(self) {
+    
+    //update function calls each frame
+    self.update = function(timeStep) {
+        //roll a node
+        self.node.roll(timeStep * 100);
+
+    }
+
+}

+ 0 - 15
Data/AtomicEditor/ProjectTemplates/Project2D/JavaScript/Resources/Components/Star.js

@@ -1,15 +0,0 @@
-"atomic component";
-
-var inspectorFields = {
-  speed: 1.0
-}
-
-exports.component = function(self) {
-
-  self.update = function(timeStep) {
-
-    self.node.rotate2D(timeStep * 75 * self.speed);
-
-  }
-
-}

+ 25 - 11
Data/AtomicEditor/ProjectTemplates/Project2D/JavaScript/Resources/Scenes/Scene.scene

@@ -5,8 +5,8 @@
 	<attribute name="Smoothing Constant" value="50" />
 	<attribute name="Snap Threshold" value="5" />
 	<attribute name="Elapsed Time" value="0" />
-	<attribute name="Next Replicated Node ID" value="364" />
-	<attribute name="Next Replicated Component ID" value="1978" />
+	<attribute name="Next Replicated Node ID" value="370" />
+	<attribute name="Next Replicated Component ID" value="1987" />
 	<attribute name="Next Local Node ID" value="16778496" />
 	<attribute name="Next Local Component ID" value="16777216" />
 	<attribute name="Variables" />
@@ -14,32 +14,46 @@
 	<component type="PhysicsWorld" id="1" />
 	<component type="Octree" id="2" />
 	<component type="DebugRenderer" id="3" />
-	<component type="Renderer2D" id="1976" />
+	<component type="Renderer2D" id="1980" />
+	<node id="2">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Zone" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Zone" id="4">
+			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
+			<attribute name="Bounding Box Max" value="10000 10000 10000" />
+			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
+		</component>
+	</node>
 	<node id="361">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Camera" />
-		<attribute name="Position" value="0 0 -5" />
+		<attribute name="Position" value="0 0 0" />
 		<attribute name="Rotation" value="1 0 0 0" />
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Variables" />
 		<component type="Camera" id="1973">
 			<attribute name="Near Clip" value="0" />
 			<attribute name="Orthographic" value="true" />
-			<attribute name="Orthographic Size" value="8" />
+			<attribute name="Orthographic Size" value="5" />
 		</component>
 	</node>
 	<node id="363">
 		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Node" />
-		<attribute name="Position" value="0 0 0" />
+		<attribute name="Name" value="Star" />
+		<attribute name="Position" value="0 0 3.4" />
 		<attribute name="Rotation" value="1 0 0 0" />
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Variables" />
-		<component type="StaticSprite2D" id="1975">
-			<attribute name="Sprite" value="Sprite2D;Sprites/star.png" />
-		</component>
 		<component type="JSComponent" id="1977">
-			<attribute name="ComponentFile" value="JSComponentFile;Components/Star.js" />
+			<attribute name="ComponentFile" value="JSComponentFile;Components/Spinner.js" />
+		</component>
+		<component type="StaticSprite2D" id="1979">
+			<attribute name="Layer" value="-100" />
+			<attribute name="Sprite" value="Sprite2D;Sprites/star.png" />
 		</component>
 	</node>
 </scene>

+ 1 - 1
Data/AtomicEditor/ProjectTemplates/Project3D/JavaScript/Resources/Scenes/Scene.scene

@@ -56,7 +56,7 @@
 	<node id="363">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Chest" />
-		<attribute name="Position" value="0 -0.374877 0" />
+		<attribute name="Position" value="0 -0.374877 2" />
 		<attribute name="Rotation" value="1 0 0 0" />
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Variables" />

+ 1 - 1
Data/AtomicEditor/ProjectTemplates/Project3D/TypeScript/Resources/Scenes/Scene.scene

@@ -56,7 +56,7 @@
 	<node id="363">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Chest" />
-		<attribute name="Position" value="0 -0.374877 0" />
+		<attribute name="Position" value="0 -0.374877 2" />
 		<attribute name="Rotation" value="1 0 0 0" />
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Variables" />