PDA

View Full Version : Align two rects



jesse_mark
14th June 2013, 16:02
Hello All,

If i have 2 rects and i want to align them, so the center of rect2 will be the same as the center of rect1.

is there a way to do this translation ?? the rect can translate its x,y. but how can i translate its center ?

wysota
14th June 2013, 17:29
rect2.moveCenter(rect1.center());