Browse Source

sound & mesh (#181)

* update physics

* update input

* update

* update code sharing in getting-help.md

* Export Compliance

* update on file i/o

* pi / 4

* inputs

* forum url

* read only user

* html5 gamepad

* sdk api update

* update

* image properties

* update editor

* defold sdk update

* animation updates

* animation fix

* run as admin

* update bob

* update about AndroidX support

* software render

* linux-faq.md update

* 4.28.2021 updates

* Basis Universal format

* sound & mesh
COCO 4 years ago
parent
commit
aeb2ec7e5b
2 changed files with 33 additions and 0 deletions
  1. 10 0
      docs/zh/manuals/project-settings.md
  2. 23 0
      docs/zh/manuals/sound.md

+ 10 - 0
docs/zh/manuals/project-settings.md

@@ -262,6 +262,16 @@ HTTP超时秒数. 设置为 `0` 则关闭超时, 默认关闭.
 #### Max Count
 spine 模型最大数目, 默认是 `128`.
 
+## Mesh
+
+#### Max Count
+每个集合最大容纳3D模型面数, 默认是 `128`.
+
+## Model
+
+#### Max Count
+每个集合最大容纳3D模型组件个数, 默认是 `128`.
+
 ## GUI
 
 #### Max Count

+ 23 - 0
docs/zh/manuals/sound.md

@@ -186,6 +186,29 @@ msg.post("/sound_gate#script", "play_gated_sound", { soundcomponent = "/sounds#e
 对于 `play_sound` 消息没法过滤因为该消息由 Defold 引擎内部保留. 如果使用引擎保留消息名会造成运行不正确.
 :::
 
+
+## 运行时控制
+可以通关一些列属性在运行时控制声音 (用法参见 [API](/ref/sound/)). 以下属性可以使用 `go.get()` 和 `go.set()` 来进行操作:
+
+`gain`
+: 声音组件音量 (`number`).
+
+`pan`
+: 声音组件角度 (`number`). 取值从 -1 (向左-45度) 到 1 (向右45度).
+
+`speed`
+: 声音组件速度 (`number`). 取值 1.0 为一般速度, 0.5 半速, 2.0 两倍速.
+
+`sound`
+: 声音资源路径 (`hash`). 可以使用 `resource.set_sound(path, buffer)` 来变更声音资源. 例如:
+
+```lua
+local boom = sys.load_resource("/sounds/boom.wav")
+local path = go.get("#sound", "sound")
+resource.set_sound(path, boom)
+```
+
+
 ## 相关项目配置
 
 在 *game.project* 文件里有些关于声音组件的 [设置项目](/manuals/project-settings#sound).