Scale with screen size

For canvas item no problem, buttons or any other UI elements can be scaled with screensize. On the other hand, I can not do this for objects. I need a box in my design and in every screensize it should fit all screen.

I need this design.

design

But when I change screensize design does not remain same.

alt text

other image

alt text

For button or canvas element there is no problem I can do it by “scale with screen size” but when it comes to objects I can not do like this. How can I do?

You may be able to use Camera.ScreenToWorldPoint() to find where the corners of the screen are in the 2D world co-ordinates, then move and scale your box objects accordingly