浏览代码

Fixed bug in modules doc.
Minor edits to editor versions and clarification in extensions.
War battles updated to match new menu layout.

Mikael Säker 7 年之前
父节点
当前提交
3b121184e3
共有 4 个文件被更改,包括 15 次插入11 次删除
  1. 5 3
      docs/en/manuals/extensions.md
  2. 3 3
      docs/en/manuals/modules.md
  3. 1 1
      docs/en/shared/editor-versions.md
  4. 6 4
      docs/en/tutorials/war-battles.md

+ 5 - 3
docs/en/manuals/extensions.md

@@ -5,7 +5,7 @@ brief: This manual explains how to write a native extension for the Defold game
 
 # Native extensions
 
-If you need custom interaction with external software or hardware on a low level where Lua won't suffice, the Defold SDK allows you to write extensions to the engine in the C++, Objective C or Java language. Typical use cases for native extensions are:
+If you need custom interaction with external software or hardware on a low level where Lua won't suffice, the Defold SDK allows you to write extensions to the engine in C, C++, Objective C, Java or Javascript, depending on target platform. Typical use cases for native extensions are:
 
 - Interaction with specific hardware, for instance the camera on mobile phones.
 - Interaction with external low level APIs, for instance advertising network APIs that do not allow interaction through network APIs where Luasocket could be used.
@@ -35,7 +35,9 @@ To create a new extension, create a folder in the project root. This folder will
 *lib*
 : This optional folder contains any compiled libraries that the extension depends on. Library files should be placed in subfolders named by `platform`, or `architecure-platform`, depending on what architectures are supported by your libraries.
 
-  Supported platforms are `ios`, `android`, `osx`, `win32`, . Supported `arc-platform` pairs are `armv7-ios`, `arm64-ios`, `armv7-android`, `x86-osx`, `x86_64-osx`, `x86-win32`, `x86_64-win32`.
+  Supported platforms are `ios`, `android`, `osx`, `win32`, `linux`.
+
+  Supported `arc-platform` pairs are `armv7-ios`, `arm64-ios`, `armv7-android`, `x86-osx`, `x86_64-osx`, `x86-win32`, `x86_64-win32`, `x86-linux`, `x86_64-linux`.
 
 *res*
 : This optional folder contains any extra resources that the extension depends on. Resource files should be placed in subfolders named by `platform`, or `architecure-platform` just as the "lib" subfolders. A subfolder `common` is also allowed, containing resource files common for all platforms.
@@ -209,7 +211,7 @@ The [Defold community asset portal](https://www.defold.com/community/assets/) al
 The native extension feature is in an alpha state, meaning that that the APIs can still change. Furthermore, not all features are in place yet.
 
 Platforms
-: There is currently no support for Linux extensions. Android lacks support for *.aar* archives. All platforms currently create debug builds only.
+: Android lacks support for *.aar* archives. All platforms currently create debug builds only.
 
 Languages
 : C++, Objective C (MacOS and iOS) and Java (Android) are supported. Swift and Kotlin are currently not supported.

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

@@ -161,8 +161,8 @@ function M.fly_randomly(radius)
     -- Can't use "."
     local go_id = go.get_id()
     -- Store origin position if it's not already stored.
-    if flying.origins[go_id] == nil then
-        flying.origins[go_id] = go.get_world_position(go_id)
+    if M.origins[go_id] == nil then
+        M.origins[go_id] = go.get_world_position(go_id)
     end
 
     -- Figure out a random position at max distance
@@ -171,7 +171,7 @@ function M.fly_randomly(radius)
     local rand_radius = math.random(radius)
     local offset = vmath.rotate(vmath.quat_rotation_z(rand_angle),
                                 vmath.vector3(rand_radius, 0, 0))
-    local rand_pos = flying.origins[go_id] + offset
+    local rand_pos = M.origins[go_id] + offset
     -- Set a random duration scaled against the radius to prevent
     -- too fast animation.
     local rand_duration = math.random(radius) / 100 + (radius / 200)

+ 1 - 1
docs/en/shared/editor-versions.md

@@ -1,6 +1,6 @@
 ## Editor 1 and 2
 
-We are currently transitioning to Defold editor 2, which right now is in beta. Most new documentation we produce is for the new editor and we will eventually update all documentation, but that process will take time. You recognize the editor version on the color theme of screenshots.
+We are currently transitioning to Defold editor 2, which right now is in beta. Most new documentation we produce is for the new editor and we will eventually update all documentation, but that process will take time. You can recognize the editor version in screenshots from the color theme.
 
 Editor 2 features a nice, dark theme:
 ![editor 2](../shared/images/editor2.png)

+ 6 - 4
docs/en/tutorials/war-battles.md

@@ -197,17 +197,19 @@ Now you have an atlas with a single flipbook animation for the player. This is e
 
 2. <kbd>Right click</kbd> the root node of the collection in the *Outline* and select <kbd>Add Game Object</kbd>. Set the *Id* property of the new game object to "player".
 
-3. Change the Z *Position* property of the game object to 1.0. Since the "map" game object is at the default Z position 0 the "player" game object needs to be at a higher value so it's drawn on top.
+3. Change the Z *Position* property of the game object named "player" to 1.0. Since the "map" game object is at the default Z position 0 the "player" game object must be at a higher value (between -1.0 and 1.0) for it to be on top of the level.
 
 4. <kbd>Right click</kbd> the game object "player" and select <kbd>Add Component ▸ Sprite</kbd>. This creates a new sprite component in the "player" game object that can show graphics.
 
-5. Set the *Image* property of the sprite to */main/sprites.atlas*.
+5. Make sure that the Z *Position* of the *Sprite* is 0 so it will be rendered at the same depth as the game object "player". Setting the Z to a different value will offset the sprite depth from 1.0
 
-6. Set the *Default Animation* property of the sprite to "player-down".
+6. Set the *Image* property of the sprite to */main/sprites.atlas*.
+
+7. Set the *Default Animation* property of the sprite to "player-down".
 
     ![player sprite](images/war-battles/player_sprite.png)
 
-7. Run the game and check that the player character is animating.
+8. Run the game and check that the player character is animating.
 
 The player game object now has visual representation in the game world. The next step is to add a script component to the player game object. This will allow you to create player behavior, such as movement. But that depends on user input, so first you need to set that up.