Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | quantumedbox |
It is stated in the docs that rect_position and rect_size has setters methods _set_position and _set_size, but when i’m overriding them - they are not being called at all
func _set_size(size: Vector2):
._set_size(size)
get_parent().get_node("Background").rect_size = size
print_debug("infobox changed size to ", size)
func _set_position(pos: Vector2):
._set_position(pos)
get_parent().get_node("Background").rect_position = pos
print_debug("infobox changed pos to ", pos)
Calling to set from another script:
func _process(delta):
$Infobox.rect_position = get_viewport().get_mouse_position()