SpriteGetRect Method |
Returns a Rect2 representing the Sprite's boundary in local coordinates. Can be used to detect if the Sprite was clicked. Example:
func _input(event): if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: if get_rect().has_point(to_local(event.position)): print("A click!")
Namespace: Godot
public Rect2 GetRect()
[Missing <returns> documentation for "M:Godot.Sprite.GetRect"]