Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RemoteTransform2D

繼承: Node2D < CanvasItem < Node < Object

RemoteTransform2D 會將自己的 Transform2D 推送到場景中另一個衍生自 CanvasItem 的節點。

說明

RemoteTransform2D 會將自己的 Transform2D 推送到場景中另一個衍生自 CanvasItem 的節點(稱為遠端節點)。

可以設定更新另一個節點的位置、旋轉和/或比例。可以使用全域座標,也可以使用局部座標。

屬性

NodePath

remote_path

NodePath("")

bool

update_position

true

bool

update_rotation

true

bool

update_scale

true

bool

use_global_coordinates

true

方法

void

force_update_cache()


屬性說明

NodePath remote_path = NodePath("") 🔗

到遠端節點的 NodePath,相對於 RemoteTransform2D 在場景中的位置。


bool update_position = true 🔗

  • void set_update_position(value: bool)

  • bool get_update_position()

如果為 true,則更新遠端節點的位置。


bool update_rotation = true 🔗

  • void set_update_rotation(value: bool)

  • bool get_update_rotation()

如果為 true,則更新遠端節點的旋轉。


bool update_scale = true 🔗

  • void set_update_scale(value: bool)

  • bool get_update_scale()

如果為 true,則更新遠端節點的比例。


bool use_global_coordinates = true 🔗

  • void set_use_global_coordinates(value: bool)

  • bool get_use_global_coordinates()

如果為 true,則使用全域座標。如果 false,則使用本地座標。


方法說明

void force_update_cache() 🔗

RemoteTransform2D 快取了遠端節點。如果遠端節點消失了,它可能不會通知;force_update_cache() 強制它再次更新快取。