Skip to content

Commit 0886dc4

Browse files
committed
Change physisc.set_listener to set_event_listener
1 parent cb739a8 commit 0886dc4

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

docs/en/manuals/physics-events.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Collision events in Defold
3-
brief: Collision event handling can be centralized by using `physics.set_listener()` to direct all collision and interaction messages to a single specified function.
3+
brief: Collision event handling can be centralized by using `physics.set_event_listener()` to direct all collision and interaction messages to a single specified function.
44
---
55

66
# Defold Physics Event Handling
77

8-
Previously, physics interactions in Defold were handled by broadcasting messages to all components of colliding objects. However, starting with version 1.6.4, Defold offers a more centralized approach through the `physics.set_listener()` function. This function allows you to set a custom listener to handle all physics interaction events in one place, thereby streamlining your code and improving efficiency.
8+
Previously, physics interactions in Defold were handled by broadcasting messages to all components of colliding objects. However, starting with version 1.6.4, Defold offers a more centralized approach through the `physics.set_event_listener()` function. This function allows you to set a custom listener to handle all physics interaction events in one place, thereby streamlining your code and improving efficiency.
99

1010
## Setting the Physics World Listener
1111

@@ -19,7 +19,7 @@ Here is an example of how to set a physics world listener within a collection pr
1919
function init(self)
2020
-- Assuming this script is attached to a game object within the collection loaded by the proxy
2121
-- Set the physics world listener for the physics world of this collection proxy
22-
physics.set_listener(physics_world_listener)
22+
physics.set_event_listener(physics_world_listener)
2323
end
2424
```
2525

@@ -101,7 +101,7 @@ local function physics_world_listener(self, event, data)
101101
end
102102

103103
function init(self)
104-
physics.set_listener(physics_world_listener)
104+
physics.set_event_listener(physics_world_listener)
105105
end
106106
```
107107

@@ -132,6 +132,6 @@ function on_message(self, message_id, message)
132132
end
133133

134134
function init(self)
135-
physics.set_listener(physics_world_listener)
135+
physics.set_event_listener(physics_world_listener)
136136
end
137137
```

docs/en/manuals/physics-messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ When two collision objects interact, we check if we should send a message to the
2020

2121
E.g. given the "Generate Contact Events" checkboxes:
2222

23-
When using `physics.set_listener()`:
23+
When using `physics.set_event_listener()`:
2424

2525
| Component A | Component B | Send Message |
2626
|-------------|-------------|--------------|

docs/ru/manuals/physics-messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ brief: Когда два объекта сталкиваются, движок
2020

2121
Например, с флажками "Generate Contact Events":
2222

23-
Если используется `physics.set_listener()`:
23+
Если используется `physics.set_event_listener()`:
2424

2525
| Компонент A | Компонент B | Отправить сообщение |
2626
|-------------|-------------|----------------------|

docs/zh/manuals/physics-events.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Defold 中的碰撞事件
3-
brief: 可以通过使用 `physics.set_listener()` 将碰撞事件处理集中化,将所有碰撞和交互消息定向到单个指定函数。
3+
brief: 可以通过使用 `physics.set_event_listener()` 将碰撞事件处理集中化,将所有碰撞和交互消息定向到单个指定函数。
44
---
55

66
# Defold 物理事件处理
77

8-
以前,Defold 中的物理交互是通过向碰撞对象的所有组件广播消息来处理的。然而,从版本 1.6.4 开始,Defold 通过 `physics.set_listener()` 函数提供了一种更集中的方法。此函数允许您设置一个自定义监听器来在一个地方处理所有物理交互事件,从而简化代码并提高效率。
8+
以前,Defold 中的物理交互是通过向碰撞对象的所有组件广播消息来处理的。然而,从版本 1.6.4 开始,Defold 通过 `physics.set_event_listener()` 函数提供了一种更集中的方法。此函数允许您设置一个自定义监听器来在一个地方处理所有物理交互事件,从而简化代码并提高效率。
99

1010
## 设置物理世界监听器
1111

@@ -19,7 +19,7 @@ brief: 可以通过使用 `physics.set_listener()` 将碰撞事件处理集中
1919
function init(self)
2020
-- 假设此脚本附加到代理加载的集合中的游戏对象上
2121
-- 为此集合代理的物理世界设置物理世界监听器
22-
physics.set_listener(physics_world_listener)
22+
physics.set_event_listener(physics_world_listener)
2323
end
2424
```
2525

@@ -101,7 +101,7 @@ local function physics_world_listener(self, event, data)
101101
end
102102

103103
function init(self)
104-
physics.set_listener(physics_world_listener)
104+
physics.set_event_listener(physics_world_listener)
105105
end
106106
```
107107

@@ -132,6 +132,6 @@ function on_message(self, message_id, message)
132132
end
133133

134134
function init(self)
135-
physics.set_listener(physics_world_listener)
135+
physics.set_event_listener(physics_world_listener)
136136
end
137137
```

docs/zh/manuals/physics-messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ brief: 当两个对象碰撞时,引擎将调用事件回调或广播消息。
2020

2121
例如,给定"生成接触事件"复选框:
2222

23-
当使用 `physics.set_listener()` 时:
23+
当使用 `physics.set_event_listener()` 时:
2424

2525
| 组件 A | 组件 B | 发送消息 |
2626
|---------|---------|----------|

0 commit comments

Comments
 (0)