Björn Ritzl 5 роки тому
батько
коміт
93af29ad2d
2 змінених файлів з 33 додано та 87 видалено
  1. 17 87
      docs/en/faq/faq.md
  2. 16 0
      docs/en/manuals/lua.md

+ 17 - 87
docs/en/faq/faq.md

@@ -63,8 +63,7 @@ What target platforms can I develop games for with Defold?
 
 What rendering API does Defold rely on?
 
-: Defold uses OpenGL ES 2.0 for graphics rendering, which is available on all our supported
-platforms.
+: Defold uses OpenGL ES 2.0 for graphics rendering, which is available on all our supported platforms.
 
 Can I do 3D games in Defold?
 
@@ -72,9 +71,7 @@ Can I do 3D games in Defold?
 
 What programming language do I work with in Defold?
 
-: All application and game logic in your Defold project is controlled through script. The Defold engine has the Lua language embedded for scripting. Lua is a lightweight dynamic language that is fast and very powerful. You can also use native code (C/C++, Objective-C, Java and JavaScript depending on the platform) to extend the Defold engine with new functionality.
-
-  When building custom materials, OpenGL ES SL shader language is used to write vertex and fragment
+: All application and game logic in your Defold project is controlled through script. The Defold engine has the Lua language embedded for scripting (specifically Lua 5.1/LuaJIT, refer to the [Lua manual](/manuals/lua) for details). Lua is a lightweight dynamic language that is fast and very powerful. You can also use native code (C/C++, Objective-C, Java and JavaScript depending on the platform) to extend the Defold engine with new functionality. When building custom materials, OpenGL ES SL shader language is used to write vertex and fragment
 shaders.
 
 Is there a way to know what version I'm running?
@@ -106,19 +103,7 @@ I'm trying to publish my game to Appstore. How should I respond to IDFA?
 
 How do I monetize my game?
 
-: Defold ships with built-in support for purchases through Apple’s Appstore "in-app purchases" on iOS devices and Google Play’s or Amazon’s "in-app billing" on Android devices. Facebook Canvas "game payments" are supported for Facebook Canvas.
-
-What about ads?
-
-: There is no built-in support for ads, but there are a couple of extensions and libraries available for various ad networks:
-
-  * *AdMob*, see https://github.com/defold/extension-admob
-  * *UnityAds*, see https://github.com/AGulev/DefUnityAds
-  * *Appodeal*, see [this forum thread](https://forum.defold.com/t/appodeal-support/1511).
-  * *FGL Enhance*, see https://github.com/enhance-co/defold-connector
-  * The Defold Ads library project includes a number of ad network, see https://github.com/britzl/defads
-
-  Check out the [Defold forum](//forum.defold.com) for more information.
+: Defold has support for in-app purchases and various advertising solutions. Check the [Monetization category in the Asset Portal](https://defold.com/tags/stars/monetization/) for an up to date list of available monetization options.
 
 ## Errors using Defold
 
@@ -160,28 +145,19 @@ Why am I getting a java exception when I try to start Defold?
 
 Does Defold support prefabs?
 
-: Yes, it does. They are called collections. They allow you to create complex game object
-  hierarchies and store those as a separate building blocks that you can instance in the
-  editor or at runtime (through collection spawning). For GUI nodes there is support for GUI templates.
+: Yes, it does. They are called collections. They allow you to create complex game object hierarchies and store those as a separate building blocks that you can instance in the editor or at runtime (through collection spawning). For GUI nodes there is support for GUI templates.
 
 I can't add a game object as a child to another game object, why?
 
-: Chances are that you try to add a child in the game object file and that is not possible.
-  To understand why, you have to remember that parent-child hierarchies are strictly a _scene-graph_
-  transform hierarchy. A game object that has not been placed (or spawned) into a scene (collection) is not part of a scene-graph and can't therefore be part of a scene-graph hierarchy.
+: Chances are that you try to add a child in the game object file and that is not possible. To understand why, you have to remember that parent-child hierarchies are strictly a _scene-graph_ transform hierarchy. A game object that has not been placed (or spawned) into a scene (collection) is not part of a scene-graph and can't therefore be part of a scene-graph hierarchy.
 
 Why can't I broadcast messages to all children of a game object?
 
-: Parent-child relations express nothing else than the scene-graph transform relations
-  and should not be mistaken for object orientation aggregates. If you try to focus on your game data and how to best transform it as your game alter its state you will likely find less need to send messages with state data to many objects all the time. In the cases where you will need data hierarchies, these are easily constructed and handled in Lua.
+: Parent-child relations express nothing else than the scene-graph transform relations and should not be mistaken for object orientation aggregates. If you try to focus on your game data and how to best transform it as your game alter its state you will likely find less need to send messages with state data to many objects all the time. In the cases where you will need data hierarchies, these are easily constructed and handled in Lua.
 
 Why am I experiencing visual artifacts around the edges of my sprites?
 
-: That is a visual artifact called "edge bleeding" where the edge pixels of neighbouring
-  pixels in an atlas bleed into the image assigned to your sprite. The solution is to pad
-  the edge of your atlas images with extra row(s) and column(s) of identical pixels.
-  Luckily this can be done automatically by the atlas editor in Defold.
-  Open your atlas and set the *Extrude Borders* value to 1.
+: That is a visual artifact called "edge bleeding" where the edge pixels of neighboring pixels in an atlas bleed into the image assigned to your sprite. The solution is to pad the edge of your atlas images with extra row(s) and column(s) of identical pixels. Luckily this can be done automatically by the atlas editor in Defold. Open your atlas and set the *Extrude Borders* value to 1.
 
 Can I tint my sprites or make them transparent, or do I have to write my own shader for it?
 
@@ -197,28 +173,15 @@ Can I tint my sprites or make them transparent, or do I have to write my own sha
 
 If I set the z coordinate of a sprite to 100 then it's not rendered. Why?
 
-: The Z-position of a game object controls rendering order. Low values are drawn before
-  higher values. In the default render script game objects with a depth ranging between -1 and 1
-  are drawn, anything lower or higher will not be drawn. You can read more about the
-  rendering script in the official [Render documentation](/manuals/render).
-  On GUI nodes the Z value is ignored and does not affect rendering order at all.
-  Instead nodes are rendered in the order they are listed and according to child hierarchies
-  (and layering). Read more about gui rendering and draw call optimization using layers
-  in the official [GUI documentation](/manuals/gui).
+: The Z-position of a game object controls rendering order. Low values are drawn before higher values. In the default render script game objects with a depth ranging between -1 and 1 are drawn, anything lower or higher will not be drawn. You can read more about the rendering script in the official [Render documentation](/manuals/render). On GUI nodes the Z value is ignored and does not affect rendering order at all. Instead nodes are rendered in the order they are listed and according to child hierarchies (and layering). Read more about gui rendering and draw call optimization using layers in the official [GUI documentation](/manuals/gui).
 
 Would changing the view projection Z-range to -100 to 100 impact performance?
 
-: No. The only effect is precision. The z-buffer is logarithmic and have very fine
-  resolution of z values close to 0 and less resolution far away from 0.
-  For instance, with a 24 bit buffer the values 10.0 and 10.000005 can be differentiated
-  whereas 10000 and 10005 cannot.
+: No. The only effect is precision. The z-buffer is logarithmic and have very fine resolution of z values close to 0 and less resolution far away from 0. For instance, with a 24 bit buffer the values 10.0 and 10.000005 can be differentiated whereas 10000 and 10005 cannot.
 
 There is no consistency to how angles are represented, why?
 
-: Actually there is consistency. Angles are expressed as degrees everywhere
-  in the editor and the game APIs. The math libs use radians. Currently the
-  convention breaks for the `angular_velocity` physics property that is
-  currently expressed as radians/s. That is expected to change.
+: Actually there is consistency. Angles are expressed as degrees everywhere in the editor and the game APIs. The math libs use radians. Currently the convention breaks for the `angular_velocity` physics property that is currently expressed as radians/s. That is expected to change.
 
 When creating a GUI box-node with only color (no texture), how will it be rendered?
 
@@ -226,19 +189,15 @@ When creating a GUI box-node with only color (no texture), how will it be render
 
 If I change assets on the fly, will the engine automatically unload them?
 
-: All resources are ref-counted internally. As soon as the ref-count is zero the resource
-  is released.
+: All resources are ref-counted internally. As soon as the ref-count is zero the resource is released.
 
 Is it possible to play audio without the use of an audio component attached to a game object?
 
-: Everything is component-based. It's possible to create a headless
-  game object with multiple sounds and play sounds by sending messages to the
-  sound-controller object.
+: Everything is component-based. It's possible to create a headless game object with multiple sounds and play sounds by sending messages to the sound-controller object.
 
 Is it possible to change the audio file associated with an audio component at run time?
 
-: In general all resources are statically declared with the benefit that
-  you get resource management for free.
+: In general all resources are statically declared with the benefit that you get resource management for free.
 
 Is there a way to access the physics collision shape properties?
 
@@ -246,21 +205,15 @@ Is there a way to access the physics collision shape properties?
 
 Is there any quick way to render the collision objects in my scene? (like Box2D's debugdraw)
 
-: Yes, set *physics.debug* flag in game.project.
-  (Refer to the official [Project settings documentation](/manuals/project-settings))
+: Yes, set *physics.debug* flag in game.project. (Refer to the official [Project settings documentation](/manuals/project-settings))
 
 What are the performance costs of having many contacts/collisions?
 
-: Defold runs a modified version of Box2D in the background and the performance cost
-  should be quite similar. You can always see how much time the engine spends on physics
-  by bringing up the [profiler](/manuals/debugging).
-  You should also consider what kind of collisions objects you use. Static objects are
-  cheaper performance wise for instance. Refer to the official [Physics
-  documentation](/manuals/physics) in Defold for more details.
+: Defold runs a modified version of Box2D in the background and the performance cost should be quite similar. You can always see how much time the engine spends on physics by bringing up the [profiler](/manuals/debugging). You should also consider what kind of collisions objects you use. Static objects are cheaper performance wise for instance. Refer to the official [Physics documentation](/manuals/physics) in Defold for more details.
 
 What's the performance impact of having many particle effect components?
 
-: It depends on if they are playing or not. A ParticleFx that isn't playing have zero performance cost. The performance implication of a playing ParticleFx must be evaluated using the profiler since it's impact depends on how it is configured. The memory cost of a ParticleFX is around 140 bytes. As with most other things the memory is allocated up front for the number of ParticleFx defined as max_count in game.project.
+: It depends on if they are playing or not. A ParticleFx that isn't playing have zero performance cost. The performance implication of a playing ParticleFx must be evaluated using the profiler since its impact depends on how it is configured. As with most other things the memory is allocated up front for the number of ParticleFx defined as max_count in game.project.
 
 How do I receive input to a game object inside a collection loaded via a collection proxy?
 
@@ -268,11 +221,7 @@ How do I receive input to a game object inside a collection loaded via a collect
 
 Can I use string type script properties?
 
-: No. Defold supports properties of [hash](/ref/builtins#hash) types. These can be used
-  to indicate types, state identifiers or keys of any kind. Hashes can also be used to store
-  game object id's (paths) although [url](/ref/msg#msg.url) properties are often
-  preferrable since the editor automatically populate a drop-down with relevant URLs
-  for you. See the [Script properties documentation](/manuals/script-properties) for details.
+: No. Defold supports properties of [hash](/ref/builtins#hash) types. These can be used to indicate types, state identifiers or keys of any kind. Hashes can also be used to store game object id's (paths) although [url](/ref/msg#msg.url) properties are often preferable since the editor automatically populate a drop-down with relevant URLs for you. See the [Script properties documentation](/manuals/script-properties) for details.
 
 How do I access the individual cells of a matrix (created using [vmath.matrix4()](/ref/vmath/#vmath.matrix4:m1) or similar)?
 
@@ -282,25 +231,6 @@ I am getting `Not enough resources to clone the node` when using [gui.clone()](/
 
 : Increase the `Max Nodes` value of the gui component. You find this value in the Properties panel when selecting the root of the component in the Outline.
 
-## Lua
-
-Which Lua standard libraries are included in Defold?
-
-: Defold includes all of the [Lua 5.1 standard libraries](http://www.lua.org/manual/5.1/manual.html#5) as well as a socket and a bit operation library:
-  - base (`assert()`, `error()`, `print()`, `ipairs()`, `require()` etc)
-  - coroutine
-  - package
-  - string
-  - table
-  - math
-  - io
-  - os
-  - debug
-  - socket (from [LuaSocket](https://github.com/diegonehab/luasocket))
-  - bitop (from [BitOp](http://bitop.luajit.org/api.html))
-
-  All libraries are documented in the [reference API documentation](/ref/go)
-
 ## The forum
 
 Can I post a thread where I advertise my work?

+ 16 - 0
docs/en/manuals/lua.md

@@ -16,6 +16,22 @@ We aim to keep Defold the same across all platforms, but we currently have a sma
 To keep your game working cross platform we suggest you stick to Lua 5.1 features.
 :::
 
+Defold includes all of the [Lua 5.1 standard libraries](http://www.lua.org/manual/5.1/manual.html#5) as well as a socket and a bit operation library:
+
+  - base (`assert()`, `error()`, `print()`, `ipairs()`, `require()` etc)
+  - coroutine
+  - package
+  - string
+  - table
+  - math
+  - io
+  - os
+  - debug
+  - socket (from [LuaSocket](https://github.com/diegonehab/luasocket))
+  - bitop (from [BitOp](http://bitop.luajit.org/api.html))
+
+All libraries are documented in the [reference API documentation](/ref/go).
+
 ## Lua books and resources
 
 * [Programming in Lua (first edition)](http://www.lua.org/pil/contents.html) Later editions are available in print.