I'm confused. What is the problem?
func new():
var up_layer = ColorRect.new()
up_layer.size = Vector2(size.x,size.y / 5)
up_layer.color = Color.RED
add_child(up_layer)
var website_button = Button.new()
up_layer.add_child(website_button)
website_button.text = "Website"
website_button.size = Vector2(up_layer.size.x / 3 / 3, up_layer.size.y / 3 )
website_button.position = Vector2(distance * 2, up_layer.size.y / 4)
print("website_button size = " + str(website_button.size))
print("website_button position = " + str(website_button.position))
var key_find_button = Button.new()
key_find_button.text = "Key Point"
key_find_button.size = Vector2(up_layer.size.x / 3 / 3, up_layer.size.y / 3)
key_find_button.position = Vector2(website_button.size.x + website_button.position.x + distance * 2, up_layer.size.y / 4)
up_layer.add_child(key_find_button)
print("key_find_button size = " + str(key_find_button.size))
print("key_find_button position = " + str(key_find_button.position))
The results are
website_button size = (102.2222, 43.2)
website_button position = (4, 32.4)
key_find_button size = (102.2222, 43.2)
key_find_button position = (110.2222, 32.4)