瀏覽代碼

Bits fixed in step by step. Pong tutorial should go away though..

Juan Linietsky 8 年之前
父節點
當前提交
6912ca4a9d

+ 6 - 1
learning/step_by_step/filesystem.rst

@@ -98,7 +98,12 @@ Drawbacks
 There are some drawbacks to this simple file system design. The first issue is that
 moving assets around (renaming them or moving them from one path to another inside
 the project) will break existing references to these assets. These references will
-have to be re-defined to point at the new asset location.
+have to be re-defined to point at the new asset location. 
+
+To avoid this, do all your move, delete and rename operations from within Godot, on the FileSystem
+dock. Never move assets from outside Godot, or dependencies will have to be
+fixed manually (Godot detects this and helps you fix them anyway, but why
+going the hardest route?).
 
 The second is that under Windows and OSX file and path names are case insensitive.
 If a developer working in a case insensitive host file system saves an asset as "myfile.PNG",

+ 2 - 2
learning/step_by_step/resources.rst

@@ -86,7 +86,7 @@ first is to use load(), like this:
 
     func _ready():
             var res = load("res://robi.png") # resource is loaded when line is executed
-            get_node("sprite").set_texture(res)
+            get_node("sprite").texture = res
 
 The second way is more optimal, but only works with a string constant
 parameter, because it loads the resource at compile-time.
@@ -95,7 +95,7 @@ parameter, because it loads the resource at compile-time.
 
     func _ready():
             var res = preload("res://robi.png") # resource is loaded at compile time
-            get_node("sprite").set_texture(res)
+            get_node("sprite").texture = res
 
 Loading scenes
 --------------

+ 13 - 16
learning/step_by_step/scripting_continued.rst

@@ -14,23 +14,24 @@ However, it is still a very common case to have a script process on every
 frame. There are two types of processing: idle processing and fixed
 processing.
 
-Idle processing is activated with the
-:ref:`Node.set_process() <class_Node_set_process>`
-function. Once active, the :ref:`Node._process() <class_Node__process>`
-callback will be called every frame. Example:
+Idle processing is activated automatically when the method :ref:`Node._process() <class_Node__process>`
+is found in a script. It can be turned off (and back on) with the
+:ref:`Node.set_process() <class_Node_set_process>` function.
 
-::
+This method will be called every frame drawn, so it's fully depend on the
+frames per second (FPS) of the application:
 
-    func _ready():
-        set_process(true)
+::
 
     func _process(delta):
         # do something...
 
 The delta parameter describes the time elapsed (in seconds, as
 floating point) since the previous call to "_process()".
+
 Fixed processing is similar, but only needed for synchronization with
-the physics engine.
+the physics engine. It is called a fixed amount of times per second
+(defined in the Project Settings, but 60 by default).
 
 A simple way to test this is to create a scene with a single Label node,
 with the following script:
@@ -41,12 +42,9 @@ with the following script:
 
     var accum=0
 
-    func _ready():
-        set_process(true)
-
     func _process(delta):
         accum += delta
-        set_text(str(accum))
+        text = (str(accum) # text is a built-in label property
 
 Which will show a counter increasing each frame.
 
@@ -73,7 +71,7 @@ all enemies can be notified about the alarm sounding, by using
 
 ::
 
-    func _on_discovered():
+    func _on_discovered(): # this is a fictional function
         get_tree().call_group("guards", "player_was_discovered")
 
 The above code calls the function "player_was_discovered" on every
@@ -142,12 +140,11 @@ follows:
         pass
 
     func _process(delta):
-        # When set_process() is enabled, this function is called every frame.
+        # This function is called every frame.
         pass
 
     func _fixed_process(delta):
-        # When set_fixed_process() is enabled, this is called every physics 
-        # frame.
+        # This is called every physics frame.
         pass
 
     func _paused():