1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Godot 4.2] Sprite2D.get_rect() で取得できる座標の原点

Last updated at Posted at 2023-12-16

Sprite2D.get_rect() で取得した矩形の座標は取得元の Sprite2Dposition が原点になる。

取得した矩形の座標を Sprite2D が存在する座標系に変換するには、 Node2D.to_global() を使いましょう。

sprite_2d.to_global(rect_2d.position)
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?