2022-06-28 10:22:03 +00:00
|
|
|
|
# 1. Line2D 节点
|
|
|
|
|
|
|
|
|
|
- 在 2D 空间中通过几个点连成的线,可以通过代码动态添加和删除
|
|
|
|
|
|
2021-10-05 16:32:06 +00:00
|
|
|
|
```
|
2022-06-28 10:22:03 +00:00
|
|
|
|
注意:默认情况下,Godot一次最多只能绘制 4,096 个多边形点。
|
|
|
|
|
要增加这个限制,请打开项目设置,修改下面两个设置
|
|
|
|
|
ProjectSettings.rendering/limits/buffers/canvas_polygon_buffer_size_kb
|
|
|
|
|
ProjectSettings.rendering/limits/buffers/canvas_polygon_index_buffer_size_kb。
|
2021-10-05 16:32:06 +00:00
|
|
|
|
```
|
|
|
|
|
|
2022-06-28 10:22:03 +00:00
|
|
|
|
# 2. RemoteTransform2D 节点
|
|
|
|
|
|
|
|
|
|
- RemoteTransform2D,类似与设计模式中的代理模式,代理一个节点
|
|
|
|
|
|
2021-10-05 16:32:06 +00:00
|
|
|
|
```
|
2022-06-28 10:22:03 +00:00
|
|
|
|
RemoteTransform2D pushes its own Transform2D to another CanvasItem derived Node in the scene.
|
2021-10-05 16:32:06 +00:00
|
|
|
|
|
2022-06-28 10:22:03 +00:00
|
|
|
|
It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates.
|
|
|
|
|
```
|
2021-10-05 16:32:06 +00:00
|
|
|
|
|
2022-06-28 10:22:03 +00:00
|
|
|
|
# 3. Path2D 节点
|
|
|
|
|
|
|
|
|
|
- Path2D,包含了一个曲线路径数据
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Contains a Curve2D path for PathFollow2D nodes to follow,Describes a Bézier curve in 2D space.
|
2021-10-05 16:32:06 +00:00
|
|
|
|
```
|
|
|
|
|
|
2022-06-28 10:22:03 +00:00
|
|
|
|
- PathFollow2D,要和Path2D结合在一起使用
|
|
|
|
|
|
2021-10-05 16:32:06 +00:00
|
|
|
|
```
|
2022-06-28 10:22:03 +00:00
|
|
|
|
This node takes its parent Path2D, and returns the coordinates of a point within it, given a distance from the first vertex.
|
2021-10-05 16:32:06 +00:00
|
|
|
|
|
2022-06-28 10:22:03 +00:00
|
|
|
|
|
|
|
|
|
It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node.
|
|
|
|
|
The descendant nodes will then move accordingly when setting an offset in this node.
|
2021-10-05 16:32:06 +00:00
|
|
|
|
```
|