summaryrefslogtreecommitdiffstats
path: root/scene/2d/node_2d.h
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2017-07-23 14:37:26 +0300
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2017-07-23 14:37:26 +0300
commit140f189a65f991d5b44d49ad6b710f7512862d16 (patch)
tree514c34550c6df621353e0163ebbeabf2e14ff8db /scene/2d/node_2d.h
parentaa798ebf8fcc0a72c837c7daea63e6d9ef51ff30 (diff)
downloadredot-engine-140f189a65f991d5b44d49ad6b710f7512862d16.tar.gz
Add .to_local/.to_global methods on Node2D and Spatial
Those are just helpers around get_global_transform().affine_inverse().xform() and get_global_transform().xform(). Closes #6087
Diffstat (limited to 'scene/2d/node_2d.h')
-rw-r--r--scene/2d/node_2d.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h
index 65331a4d58..5b3a28d5c3 100644
--- a/scene/2d/node_2d.h
+++ b/scene/2d/node_2d.h
@@ -104,6 +104,9 @@ public:
void look_at(const Vector2 &p_pos);
float get_angle_to(const Vector2 &p_pos) const;
+ Point2 to_local(Point2 p_global) const;
+ Point2 to_global(Point2 p_local) const;
+
void set_z_as_relative(bool p_enabled);
bool is_z_relative() const;