added method to set the position as an object directly instead of the independent x and y values