浏览代码

User feedback

Björn Ritzl 6 年之前
父节点
当前提交
c9b24b67cc

+ 2 - 3
docs/en/manuals/gui-script.md

@@ -70,7 +70,7 @@ stack traceback:
 
 ## Message passing
 
-Any GUI component with a script attached is able to communicate with other objects in your game runtime environment through message passing, it will behave like any other script component. 
+Any GUI component with a script attached is able to communicate with other objects in your game runtime environment through message passing, it will behave like any other script component.
 
 You address the GUI component like you would any other script component:
 
@@ -111,7 +111,7 @@ gui.set_color(new_boxnode, vmath.vector4(0.2, 0.26, 0.32, 1))
 -- Create a new text node
 local new_textnode = gui.new_text_node(new_position, "Hello!")
 gui.set_font(new_textnode, "sourcesans")
-gui.set_color(new_textnode, vmath.vector4(0.69, 0.6
+gui.set_color(new_textnode, vmath.vector4(0.69, 0.6, 0.8, 1.0))
 ```
 
 ![dynamic node](images/gui-script/dynamic_nodes.png){srcset="images/gui-script/[email protected] 2x"}
@@ -147,4 +147,3 @@ local new_textnode = gui.new_text_node(vmath.vector3(100, 100, 0), "Hello!")
 -- The node has no id, and that is fine. There's no reason why we want
 -- to do gui.get_node() when we already have the reference.
 ```
-

+ 1 - 1
docs/en/manuals/gui-template.md

@@ -15,7 +15,7 @@ A GUI template is a plain GUI scene so it is created just like any other GUI sce
 
 ![Create template](images/gui-templates/create.png){srcset="images/gui-templates/[email protected] 2x"}
 
-Create the template and save it. Note that the nodes of the instance will be placed relative to origo so it is a good idea to create the template at position 0, 0, 0.
+Create the template and save it. Note that the nodes of the instance will be placed relative to origin so it is a good idea to create the template at position 0, 0, 0.
 
 ## Creating instances from a template
 

+ 1 - 1
docs/en/manuals/shader.md

@@ -34,7 +34,7 @@ Fragment shader
   The output of the fragment shader is the color value for the particular fragment (`gl_FragColor`).
 
 World matrix
-: The vertex positions of a model's shape are stored relative to the model's origo. This is called "model space". The game world, however, is a "world space" where the position, orientation and scale of each vertex is expressed relative to the world origo. By keeping these separate the game engine is able to move, rotate and scale each model without destroying the original vertex values stored in the model component.
+: The vertex positions of a model's shape are stored relative to the model's origin. This is called "model space". The game world, however, is a "world space" where the position, orientation and scale of each vertex is expressed relative to the world origin. By keeping these separate the game engine is able to move, rotate and scale each model without destroying the original vertex values stored in the model component.
 
   When a model is placed in the game world the model's local vertex coordinates must be translated to world coordinates. This translation is done by a *world transform matrix*, which tells what  translation (movement), rotation and scale should be applied to a model's vertices to be correctly placed in the game world's coordinate system.
 

+ 4 - 4
docs/en/tutorials/15-puzzle.md

@@ -71,7 +71,7 @@ Set the tile *Width* and *Height* properties to 128. This will split the 512⨉5
 
 Next, <kbd>Right click</kbd> the *main* folder and select <kbd>New ▸ Tile Map</kbd>. Name the new file "grid.tilemap".
 
-Defold needs you to initialize the grid. To do that, select the "layer1" layer and paint the 4⨉4 grid of tiles just to the top-right of origo. It does not really matter what you set the tiles to. You will write code in a bit that will set the content of these tiles automatically. 
+Defold needs you to initialize the grid. To do that, select the "layer1" layer and paint the 4⨉4 grid of tiles just to the top-right of origin. It does not really matter what you set the tiles to. You will write code in a bit that will set the content of these tiles automatically. 
 
 ![Tile map](images/15-puzzle/tilemap.png)
 
@@ -81,7 +81,7 @@ Open *main.collection*. <kbd>Right click</kbd> the root node in the *Outline* an
 
 <kbd>Right click</kbd> the game object and select <kbd>Add Component File</kbd>. Select the file *grid.tilemap*.
 
-<kbd>Right click</kbd> the game object and select <kbd>Add Component ▸ Label</kbd>. Set the *Id* property of the label to "done" and its *Text* property to "Well done". Move the label to the center of the tilemap. 
+<kbd>Right click</kbd> the game object and select <kbd>Add Component ▸ Label</kbd>. Set the *Id* property of the label to "done" and its *Text* property to "Well done". Move the label to the center of the tilemap.
 
 Set the Z position of the label to 1 to make sure it's drawn on top of the grid.
 
@@ -285,7 +285,7 @@ Open */input/game.input_bindings* and add a new *Mouse Trigger*. Set the name of
 
 ![input](images/15-puzzle/input.png)
 
-Go back to the script and create an `on_input()` function. 
+Go back to the script and create an `on_input()` function.
 
 ```lua
 -- Deal with user input
@@ -419,4 +419,4 @@ end
 ## Further exercises
 
 1. Make a 5⨉5 puzzle, then a 6⨉5 one. Make sure the solvability checks work generally.
-2. Add sliding animations. Tiles cannot be moved separately from the tilemap so you will have to come up with a way of solving that. Perhaps a separate tilemap that only contains the sliding piece?
+2. Add sliding animations. Tiles cannot be moved separately from the tilemap so you will have to come up with a way of solving that. Perhaps a separate tilemap that only contains the sliding piece?

+ 17 - 17
docs/en/tutorials/grading.md

@@ -33,7 +33,7 @@ We need to modify the built in render script and add the new rendering functiona
 1. Copy */builtins/render/default.render_script*: In the *Asset* view, right click *default.render_script*, select <kbd>Copy</kbd> then right click *main* and select <kbd>Paste</kbd>. Right click the copy and select <kbd>Rename...</kbd> and give it a suitable name, like "grade.render_script".
 2. Create a new render file called */main/grade.render* by right clicking *main* in the *Asset* view and selecting <kbd>New ▸ Render</kbd>.
 3. Open *grade.render* and set its *Script* property to "/main/grade.render_script".
-   
+
    ![grade.render](images/grading/grade_render.png)
 
 4. Open *game.project* and set *Render* to "/main/grade.render".
@@ -92,7 +92,7 @@ Now we just need to wrap the original rendering code with `render.enable_render_
 ```lua
 function update(self)
   render.enable_render_target(self.target) -- <1>
-  
+
   render.set_depth_mask(true)
   render.set_stencil_mask(0xff)
   render.clear({[render.BUFFER_COLOR_BIT] = self.clear_color, [render.BUFFER_DEPTH_BIT] = 1, [render.BUFFER_STENCIL_BIT] = 0})
@@ -100,7 +100,7 @@ function update(self)
   render.set_viewport(0, 0, render.get_width(), render.get_height()) -- <2>
   render.set_view(self.view)
   ...
-  
+
   render.disable_render_target(self.target) -- <3>
 end
 ```
@@ -123,7 +123,7 @@ Create a quadratic plane mesh in Blender (or any other 3D modelling program). Se
 3. Add a Model component to the "grade" game object.
 3. Set the *Mesh* property of the model component to the *quad.dae* file.
 
-Leave the game object unscaled at origo. Later, when we render the quad we will project it so it fills the whole screen. But first we need a material and shader programs for the quad:
+Leave the game object unscaled at origin. Later, when we render the quad we will project it so it fills the whole screen. But first we need a material and shader programs for the quad:
 
 1. Create a new material and call it *grade.material* by right clicking *main* in the *Asset* view and selecting <kbd>New ▸ Material</kbd>.
 2. Create a vertex shader program called *grade.vp* and a fragment shader program called *grade.fp* by right clicking *main* in the *Asset* view and selecting <kbd>New ▸ Vertex program</kbd> and <kbd>New ▸ Fragment program</kbd>.
@@ -199,9 +199,9 @@ After the render target's color buffer has been filled in `update()` we set up a
 ```lua
 function update(self)
   render.enable_render_target(self.target)
-  
+
   ...
-  
+
   render.disable_render_target(self.target)
 
   render.clear({[render.BUFFER_COLOR_BIT] = self.clear_color}) -- <1>
@@ -209,7 +209,7 @@ function update(self)
   render.set_viewport(0, 0, render.get_window_width(), render.get_window_height()) -- <2>
   render.set_view(vmath.matrix4()) -- <3>
   render.set_projection(vmath.matrix4())
-  
+
   render.enable_texture(0, self.target, render.BUFFER_COLOR_BIT) -- <4>
   render.draw(self.grade_pred) -- <5>
   render.disable_texture(0, self.target) -- <6>
@@ -217,7 +217,7 @@ end
 ```
 1. Clear the frame buffer. Note that the previous call to `render.clear()` affects the render target, not the screen frame buffer.
 2. Set the viewport to match the window size.
-3. Set the view to the identity matrix. This means camera is at origo looking straight along the Z axis. Also set the projection to the identity matrix causing the the quad to be projected flat across the whole screen.
+3. Set the view to the identity matrix. This means camera is at origin looking straight along the Z axis. Also set the projection to the identity matrix causing the the quad to be projected flat across the whole screen.
 4. Set texture slot 0 to the color buffer of the render target. We have sampler "original" at slot 0 in our *grade.material* so the fragment shader will sample from the render target.
 5. Draw the predicate we created matching any material with the tag "grade". The quad model uses *grade.material* which sets that tag---thus the quad will be drawn.
 6. After drawing, disable texture slot 0 since we are done drawing with it.
@@ -317,21 +317,21 @@ Let's implement the texture lookup in the fragment shader:
 
     #define MAXCOLOR 15.0 // <2>
     #define COLORS 16.0
-    #define WIDTH 256.0 
+    #define WIDTH 256.0
     #define HEIGHT 16.0
 
     void main()
     {
         vec4 px = texture2D(original, var_texcoord0.xy); // <3>
-        
+
         float cell = floor(px.b * MAXCOLOR); // <4>
-       
+
         float half_px_x = 0.5 / WIDTH; // <5>
         float half_px_y = 0.5 / HEIGHT;
 
         float x_offset = half_px_x + px.r / COLORS * (MAXCOLOR / COLORS);
         float y_offset = half_px_y + px.g * (MAXCOLOR / COLORS); // <6>
-      
+
         vec2 lut_pos = vec2(cell / COLORS + x_offset, y_offset); // <7>
 
         vec4 graded_color = texture2D(lut, lut_pos); // <8>
@@ -408,17 +408,17 @@ uniform lowp sampler2D lut;
 void main()
 {
   vec4 px = texture2D(original, var_texcoord0.xy);
-    
+
     float cell = px.b * MAXCOLOR;
 
     float cell_l = floor(cell); // <1>
     float cell_h = ceil(cell);
-    
+
     float half_px_x = 0.5 / WIDTH;
     float half_px_y = 0.5 / HEIGHT;
     float r_offset = half_px_x + px.r / COLORS * (MAXCOLOR / COLORS);
     float g_offset = half_px_y + px.g * (MAXCOLOR / COLORS);
-    
+
     vec2 lut_pos_l = vec2(cell_l / COLORS + r_offset, g_offset); // <2>
     vec2 lut_pos_h = vec2(cell_h / COLORS + r_offset, g_offset);
 
@@ -447,7 +447,7 @@ Okay, that was a lot of work to draw something that looks exactly like the origi
 1. Take a screenshot of the game in its unaffected form.
 2. Open the screenshot in your favorite image manipulation program.
 3. Apply any number of color adjustments (brightness, contrast, color curves, white balance, exposure etc, etc).
-    
+
     ![world in Affinity](images/grading/world_graded_affinity.png)
 
 4. Apply the same color adjustments to the lookup table texture file (*lut16.png*).
@@ -457,4 +457,4 @@ Okay, that was a lot of work to draw something that looks exactly like the origi
 
 ![world graded](images/grading/world_graded.png)
 
-Joy!
+Joy!