소스 검색

A ton of reported issues fixed.

Mikael Säker 7 년 전
부모
커밋
b98b03786d

+ 2 - 3
docs/en/manuals/2dgraphics.md

@@ -16,8 +16,7 @@ Atlases
 
 
 Tile Sources
-: A tile source references an image file that is already containing sub-images ordered on a uniform grid. Other tools sometimes use the terms _tile set_ and _sprite sheet_ for this type of image. See http://en.wikipedia.org/wiki/Tileset#Tile_set
-
+: A tile source references an image file that is already containing sub-images ordered on a uniform grid. Other tools sometimes use the terms _tile set_ and _sprite sheet_ for this type of image. See https://en.wikipedia.org/wiki/Tile-based_video_game for an overview of tile based games.
 
 ## Importing Image Files
 
@@ -157,7 +156,7 @@ To obtain effects like flashing a sprite white when it is hit, you can implement
 - Open the copied *sprite.material* file and remap the shader files (*.vp* and *.fp*) to your own copies.
 - Edit the *.vp* and *.fp* copies as you please. If you introduce shader constants, they must also be declared in the material file.
 - Open your sprite and specify your new material in the Properties.
-- To set a shader constant while the game is running, use the functions [`sprite.set_constant()`](/ref/sprite#sprite.set_constant) and [`sprite.reset_contant()`](/ref/sprite#sprite.reset_constant).
+- To set a shader constant while the game is running, use the functions [`sprite.set_constant()`](/ref/sprite#sprite.set_constant) and [`sprite.reset_constant()`](/ref/sprite#sprite.reset_constant).
 
 ## Tile Maps
 

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

@@ -51,7 +51,7 @@ usage: bob [options] [commands]
  -r,--root <arg>                     Build root directory. Default is
                                      current directory
  -tc,--texture-compression <arg>     Use texture compression as specified
-                                     in texture profiles
+                                     in texture profiles (boolean)
  -u,--auth <arg>                     User auth token
  -v,--verbose                        Verbose output
 ```

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

@@ -388,7 +388,7 @@ Several of the node properties can be fully asynchronously animated. To animate
 `gui.animate(node, property, to, easing, duration [,delay] [,complete_function] [,playback])`
 
 ::: sidenote
-See [`go.animate()`](/ref/go#go.animate) for details on the parameters.
+See [`gui.animate()`](/ref/gui#gui.animate) for details on the parameters.
 :::
 
 The `property` parameter is usually given as a constant (`gui.PROP_POSITION` etc), but can also be supplied as described in the Properties guide (see [Properties](/manuals/properties)). This is handy if you want to animate just a specific component of a compound property value.

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

@@ -26,7 +26,7 @@ Game tutorials
 : ![Tutorials](images/introduction/tutorials.jpg){.left} [Learning by building games](/tutorials/) is something we encourage. We have a variety of tutorials available at different skill and complexity level. Following one or two of them may help you understand better how to put things together in Defold.
 
 The building blocks of Defold
-: ![Building blocks](images/introduction/building_blocks.png){.left} [Defold games are build by composing simple blocks](/manuals/building-blocks/), some of which seem familiar if you have used other engines. There are some architectural design decisions that make the blocks of Defold special and it takes a little while to be comfortable working with them. Our building blocks manual is a good start if yuo feel you need to understand thoroughly how it's working.
+: ![Building blocks](images/introduction/building_blocks.png){.left} [Defold games are build by composing simple blocks](/manuals/building-blocks/), some of which seem familiar if you have used other engines. There are some architectural design decisions that make the blocks of Defold special and it takes a little while to be comfortable working with them. Our building blocks manual is a good start if you feel you need to understand thoroughly how it's working.
 
 The forum
 : ![Forum](images/introduction/forum.jpg){.left} [Learning from others](//forum.defold.com/) is often the best way to learn. Our community is very friendly and knows a lot about building games in general and Defold in particular. If you ever get stuck, don't hesitate but head over to the forum for help!

+ 5 - 1
docs/en/manuals/ios.md

@@ -84,7 +84,11 @@ When you have the code signing identity and privisioning profile, you are ready
 
 Select your code signing identity and browse for your mobile provisioning file. Press *Package* and you will then be prompted to specify where on your computer the bundle will be created.
 
-You specify what icon to use for the app, the launch screen image and so forth on the *game.project* project settings file.
+You specify what icon to use for the app, the launch screen image(s) and so forth on the *game.project* project settings file.
+
+:::important
+When your game launches on iOS, the launch images are used to set the correct screen resolution. If you do not supply the correct image size, you will get a lower resolution with resulting black bars.
+:::
 
 ![ipa iOS application bundle](images/ios/ipa_file.png){.left}
 

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

@@ -519,7 +519,7 @@ GUI scripts
 
 
 Render scripts
-: Extension _.renderscript_. Run by the rendering pipeline and containing the logic required to render all app/game graphics each frame. Render scripts have access to the [Render](/ref/render) library functions.
+: Extension _.render_script_. Run by the rendering pipeline and containing the logic required to render all app/game graphics each frame. Render scripts have access to the [Render](/ref/render) library functions.
 
 
 ## Script execution and callbacks

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

@@ -239,7 +239,7 @@ local M = {}
 
 --- Constant for bar
 -- @field BAR
-local M.BAR = "bar"
+M.BAR = "bar"
 
 local function private_function()
 end

+ 28 - 18
docs/en/manuals/physics.md

@@ -275,26 +275,36 @@ It is straightforward to calculate the distance the previous movement out of Obj
 The distance covered can be found if we project the penetration vector of Object A against the one of Object B. To find the final movement we need to perform we just subtract +l+ from our original penetration vector. For an arbitrary number of penetrations, we can accumulate the actual movements into a vector and project against each penetration vector in turn. The full implementation looks like this:
 
 ```lua
+function init(self)
+  -- correction vector
+  self.correction = vmath.vector3()
+end
+
+function update(self, dt)
+  -- reset correction
+  self.correction = vmath.vector3()
+end
+
 function on_message(self, message_id, message, sender)
-    -- Handle collision
-    if message_id == hash("contact_point_response") then
-        -- Get the info needed to move out of collision. We might
-        -- get several contact points back and have to calculate
-        -- how to move out of all accumulatively:
-        if message.distance > 0 then
-            -- First, project the penetration vector on
-            -- accumulated correction
-            local proj = vmath.project(self.correction, message.normal * message.distance)
-            if proj < 1 then
-                -- Only care for projections that does not overshoot.
-                local comp = (message.distance - message.distance * proj) * message.normal
-                -- Apply compensation
-                go.set_position(go.get_position() + comp)
-                -- Accumulate the corrections done
-                self.correction = self.correction + comp
-            end
-        end
+  -- Handle collision
+  if message_id == hash("contact_point_response") then
+    -- Get the info needed to move out of collision. We might
+    -- get several contact points back and have to calculate
+    -- how to move out of all accumulatively:
+    if message.distance > 0 then
+      -- First, project the penetration vector on
+      -- accumulated correction
+      local proj = vmath.project(self.correction, message.normal * message.distance)
+      if proj < 1 then
+        -- Only care for projections that does not overshoot.
+        local comp = (message.distance - message.distance * proj) * message.normal
+        -- Apply compensation
+        go.set_position(go.get_position() + comp)
+        -- Accumulate the corrections done this frame
+        self.correction = self.correction + comp
+      end
     end
+  end
 end
 ```
 

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

@@ -126,7 +126,7 @@ Create a quadratic plane mesh in Blender (or any other 3D modelling program). Se
 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:
 
 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>.
+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>.
 3. Open *grade.material* and set the *Vertex program* and *Fragment program* properties to the new shader program files.
 4. Add a *Vertex constant* named "view_proj" of type `CONSTANT_TYPE_VIEWPROJ`. This is the view and projection matrix used in the vertex program for the quad vertices.
 5. Add a *Sampler* called "original". This will be used to sample pixels from the off-screen render target color buffer.
@@ -306,7 +306,7 @@ Let's implement the texture lookup in the fragment shader:
 
     ![quad model lut](images/grading/quad_lut.png)
 
-6. Finally, open *grading.fp* so we can add support for color lookup:
+6. Finally, open *grade.fp* so we can add support for color lookup:
 
     ```glsl
     varying mediump vec4 position;

BIN
docs/en/tutorials/images/runner/2/spinemodel_properties.png


+ 6 - 6
docs/en/tutorials/runner.md

@@ -126,7 +126,7 @@ It's perhaps not very exciting, but it's a running Defold game application and w
 First of all, let's clean the *main.collection* file of the one game object it contains.
 
 * Double click the file *main.collection* to open it in the editor.
-* Select (click) "go" in the *Outline* view to the right.
+* Select (click) "logo" in the *Outline* view to the right.
 * Right-click and select <kbd>Delete</kbd> from the pop up menu.
 * Save the file. Select <kbd>File ▸ Save</kbd> in the main menu.
 That's it!
@@ -150,7 +150,7 @@ Let's take the first baby steps and create an arena for our character, or rather
 
 <a class="btn btn-primary btn-xs-block btn-icon" href="//storage.googleapis.com/defold-doc/assets/runner-assets.zip">Download asset package<span aria-hidden="true" class="icon icon-download"></span></a>
 
-1. Import the image assets into the project by dragging the *ground01.png* and *ground02.png* image files into a suitable location in the project, for instance a new folder called *images* inside the *main* folder.
+1. Import the image assets into the project by dragging the files "ground01.png" and "ground02.png" image files (from the sub-folder "level-images" in the asset package) into a suitable location in the project, for instance the folder "images" inside the "main" folder.
 2. Create a new *Atlas* file to hold the ground textures (right-click a suitable folder, for instance the *main* folder, in the *Project Explorer* and select <kbd>New ▸ Atlas File</kbd>). Name the atlas file *level.atlas*.
 
   ::: sidenote
@@ -270,7 +270,7 @@ A *Script*
 
 Start by importing the body part images, then add them to a new atlas that we call *hero.atlas*:
 
-1. Create a new folder by right-clicking in the *Project Explorer* and selecting <kbd>New ▸ Folder</kbd>. Make sure to not select a folder before clicking or the new folder will be created inside the marked one.
+1. Create a new folder by right-clicking in the *Project Explorer* and selecting <kbd>New ▸ Folder</kbd>. Make sure to not select a folder before clicking or the new folder will be created inside the marked one. Name the folder "hero".
 2. Create a new atlas file by right-clicking the *hero* folder and selecting <kbd>New ▸ Atlas File</kbd>. Name the file *hero.atlas*.
 3. Create a new subfolder *images* in the *hero* folder. Right-click the *hero* folder and select <kbd>New ▸ Folder</kbd>.
 4. Drag the bodypart images from the *hero-images* folder in the asset package to the *images* folder you just created in the *Project Explorer*.
@@ -451,7 +451,7 @@ The last thing we need for the hero to be functional is input. The script above
 <a name="part-5"></a>
 ## STEP 5 - Refactoring the level
 
-Now that we have a hero character set up with collision and all, we need to also add collision to the ground so the frog has got something to collide with (or run on). We'll do that in a second, but first, let's do a little refactoring and put all level stuff in a separate collection and clean up the file structure a bit:
+Now that we have a hero character set up with collision and all, we need to also add collision to the ground so the frog has got something to collide with (or run on). We'll do that in a second, but first, we should do a little refactoring and put all level stuff in a separate collection and clean up the file structure a bit:
 
 1. Create a new *level.collection* file (right-click *main* in the *Project Explorer* and select <kbd>New ▸ Collection File</kbd>).
 2. Open the new file, right-click the root in the *Outline* and select <kbd>Add Collection from File</kbd> and choose *ground.collection*.
@@ -543,7 +543,7 @@ To make life in frog-world a little less dull, we should add platforms to jump o
 4. Create a new *Game Object* file called *platform.go* in the *level* folder. (Right-click *level*
  in the *Project Explorer* then select <kbd>New ▸ Game Object File</kbd>)
 5. Add a *Sprite* component to the game object (right-click the root in the *Outline* view and select <kbd>Add Component</kbd> and then *Sprite*).
-6. Set the *Image* property to refer to the file *level.atlas* and set *Default Animation* to "rock_planks". (For convenience you might wanna keep level objects in a subfolder "level/objects" but that is not necessary)
+6. Set the *Image* property to refer to the file *level.atlas* and set *Default Animation* to "rock_planks". For convenience, keep level objects in a subfolder "level/objects".
 7. Add a *Collision Object* component to the platform game object (right-click the root in the *Outline* view and select <kbd>Add Component</kbd>).
 8. Make sure to set the component's *Type* to "Kinematic" and the *Group* and *Mask* to "geometry" and "hero" respectively
 9. Add a *Box Shape* to the *Collision Object* component. (Right-click the component in the *Outline* and select <kbd>Add Shape</kbd>, then choose *Box*).
@@ -855,7 +855,7 @@ Next up - something to live for: coins!
 
 The idea is to put coins in the level for the player to collect. The first questions to ask is how to put them into the level. We can, for instance, develop a spawning scheme that is somehow in tune with the platform spawning algorithm. However, we chose a much easier approach in the end and just have the platforms themselves spawn coins:
 
-1. Drag the *coins.png* image from the asset package to "level/images" in the *Project Explorer*.
+1. Drag the *coin.png* image from the asset package to "level/images" in the *Project Explorer*.
 2. Open *level.atlas* and add the image (right-click and select <kbd>Add Images</kbd>).
 3. Create a *Game Object* file named *coin.go* in the *level* folder (right-click *level* in the *Project Explorer* and select <kbd>New ▸ Game Object File</kbd>).
 4. Open *coin.go* and add a *Sprite* component (right-click and select <kbd>Add Component</kbd> in the *Outline*). Set the *Image* to *level.atlas* and *Default Animation* to "coin".

+ 3 - 7
docs/en/tutorials/war-battles.md

@@ -59,10 +59,6 @@ The editor now opens. If you are new to Defold, take a moment to familiarize you
 
 :[overview](../shared/editor-views.md)
 
-## Editor overview
-
-![editor overview](images/war-battles/editor_overview.png)
-
 ## Cleaning the project
 
 The empty project template is not 100% empty so we should fix that:
@@ -77,7 +73,7 @@ Now the project is totally empty. You can verify this by selecting <kbd>Project
 
 ## Drawing the game map
 
-Your game needs a setting, a map. The map that you are going to draw will be made out of tiles, small images that are put together like a mosaic into a larger image. In Defold, such an image is called a *Tile map*. In order to create a tile map, you need to import an image file that contain the various tiles. You then need to specify the size of the tiles, margins and padding on that image. This setup is done in a file of a type called *Tile source*.
+Your game needs a setting, a map. The map that you are going to draw will be made out of tiles, small images that are put together like a mosaic into a larger image. In Defold, such an image is called a *Tile map*. In order to create a tile map, you need to import an image file that contains the various tiles. You then need to specify the size of the tiles, margins and padding on that image. This setup is done in a file of a type called *Tile source*.
 
 1. Download the "War Battles" asset package. The file is a ZIP archive that you have to unpack on your hard drive.
 
@@ -151,7 +147,7 @@ Defold stores everything you build in *collections*. A collection is a container
 
     ![add images](images/war-battles/add_images.png)
 
-6. With the animation group marked, select <kbd>View ▸ Play</kbd> from the menu to preview the animation. It will play back at full 60 FPS which is way too fast. Set the playback speed (*Fps* property) to 8.
+6. With the animation group marked, select <kbd>View ▸ Play</kbd> from the menu to preview the animation. Press <kbd>F</kbd> to frame the animation in the editor if necessary. The animation will play back at full 60 FPS which is way too fast. Set the playback speed (*Fps* property) to 8.
 
     ![play animation](images/war-battles/play_animation.png)
 
@@ -260,7 +256,7 @@ end
 11. Add the current direction vector (scaled to speed and frame interval) to the position.
 12. Set the position of the game object to the new position.
 13. After the calculations have been made, set the input vector to 0 and unset the `moving` flag.
-14. The `on_input()` function is called every frame for all mapped input that is active. The argument `action_id` contain the action as set up in the input bindings file. The argument `action` is a Lua table with details on the input.
+14. The `on_input()` function is called every frame for all mapped input that is active. The argument `action_id` contains the action as set up in the input bindings file. The argument `action` is a Lua table with details on the input.
 15. For each input direction, set the X or the Y component of the `input` vector in `self`. If the user presses the <kbd>up arrow</kbd> and <kbd>left arrow</kbd> keys, the engine will call this function twice and the input vector will end up being set to `(-1, 1, 0)`.
 16. If the user presses any of the arrow keys, the input vector length will be non zero. If so, set the `moving` flag so the player will be moved in `update()`. The reason the script does not move the player in the `on_input()` function is that it is simpler to collect all input each frame and then act upon it in `update()`.
 17. The `dir` direction vector is set to the normalized value of the input. If the input vector is `(-1, 1, 0)`, for instance, the vector length is greater than 1. Normalizing the vector brings it to a length of exactly 1. Without normalization diagonal movement would be faster than horizontal and vertical. When the engine runs the `update()` function, any user input will have an effect on the `dir` vector which will cause the player to move.