Browse Source

Renamed TS component scripts to match other language versions.
Made things more consistent

Ken Paulson 8 years ago
parent
commit
701865a691

+ 31 - 31
Data/AtomicEditor/ProjectTemplates/Project2D/TypeScript/Resources/Components/Star.js → Data/AtomicEditor/ProjectTemplates/Project2D/TypeScript/Resources/Components/Spinner.js

@@ -1,31 +1,31 @@
-"atomic component";
-"use strict";
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-/**
- * Component that will rotate a node at a configurable speed.
- */
-var Star = (function (_super) {
-    __extends(Star, _super);
-    function Star() {
-        _super.apply(this, arguments);
-        /**
-         * Fields witihin the inspectorFields object will be exposed to the editor
-         */
-        this.inspectorFields = {
-            speed: 1.0
-        };
-    }
-    /**
-     * Update called every cycle with timeStep containing the delta between calls
-     * @param  {number} timeStep time since last call to update
-     */
-    Star.prototype.update = function (timeStep) {
-        this.node.rotate2D(timeStep * 75 * this.speed);
-    };
-    return Star;
-})(Atomic.JSComponent);
-exports.default = Star;
+"atomic component";
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+/**
+ * Component that will rotate a node at a configurable speed.
+ */
+var Star = (function (_super) {
+    __extends(Star, _super);
+    function Star() {
+        _super.apply(this, arguments);
+        /**
+         * Fields witihin the inspectorFields object will be exposed to the editor
+         */
+        this.inspectorFields = {
+            speed: 1.0
+        };
+    }
+    /**
+     * Update called every cycle with timeStep containing the delta between calls
+     * @param  {number} timeStep time since last call to update
+     */
+    Star.prototype.update = function (timeStep) {
+        this.node.rotate2D(timeStep * 75 * this.speed);
+    };
+    return Star;
+})(Atomic.JSComponent);
+exports.default = Star;

+ 4 - 4
Data/AtomicEditor/ProjectTemplates/Project2D/TypeScript/Resources/Components/Star.ts → Data/AtomicEditor/ProjectTemplates/Project2D/TypeScript/Resources/Components/Spinner.ts

@@ -6,25 +6,25 @@
 export default class Star extends Atomic.JSComponent {
 
     /**
-     * Fields witihin the inspectorFields object will be exposed to the editor
+     * Fields within the inspectorFields object will be exposed to the editor
      */
     inspectorFields = {
         speed: 1.0
     };
 
     /**
-     * The speed in which to turn the component
+     * The speed at which to turn the component
      * @type {number}
      */
     speed: number;
 
     /**
      * Update called every cycle with timeStep containing the delta between calls
-     * @param  {number} timeStep time since last call to update
+     * @param  {number} timeStep time since last call to update in seconds
      */
     update(timeStep) {
 
-        this.node.rotate2D(timeStep * 75 * this.speed);
+        this.node.roll(this.speed * timeStep * 75);
 
     }
 }

+ 25 - 11
Data/AtomicEditor/ProjectTemplates/Project2D/TypeScript/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>