Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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 ( bool value )

  • bool get_update_position ( )

如果为 true,则更新远程节点的位置。


bool update_rotation = true

  • void set_update_rotation ( bool value )

  • bool get_update_rotation ( )

如果为 true,则更新远程节点的旋转。


bool update_scale = true

  • void set_update_scale ( bool value )

  • bool get_update_scale ( )

如果为 true,则更新远程节点的比例。


bool use_global_coordinates = true

  • void set_use_global_coordinates ( bool value )

  • bool get_use_global_coordinates ( )

如果为 true,则使用全局坐标。如果 false,则使用本地坐标。


方法说明

void force_update_cache ( )

RemoteTransform2D 缓存了远程节点。如果远程节点消失了,它可能不会通知;force_update_cache 强制它再次更新缓存。