txt.x = (rectangle.width - txt.width)*0.5 + rectangle.x; txt.y = (rectangle.height - txt.height)*0.5 + rectangle.y;