Hi Michael
This is what I do now (see my function below)
The problem is that the object has to move closer to the camera if the
screensize is changing so it fits the screen.
Now I move it in a loop while checking it's new size and in some cases
its quite long.
What I search for is a way of calculating with a formula on what
distance I place the object to the camera so it fits the screen.
Thanks
jens
Le 25/02/2011 17:50, Michael Iv a écrit :
Use bounding box dimensions of the plane to calculate it's width and
from there edge location is not a problem
Sent from my iPhone
On Feb 23, 2011, at 5:25 PM, jens lofberg <[email protected]
<mailto:[email protected]>> wrote:
Hi (and thanks for a great tool)
I need to calculate how close to the camera I put a plane so the
space between the plane edge and the screen edge is always the same.
The size of the plane is dynamic.
For now I start my sceen by moving my plane in z until I get the good
size, using:
public function getScreenSize():Object {
var sessionContainer:DisplayObjectContainer =
_view.session.getContainer(_view) as DisplayObjectContainer;
var drawnObject:DisplayObject =
sessionContainer.getChildAt(0);
return (drawnObject.getRect(this))
}
Does anyone know a Math formula doing the same thing?
Thanks
jens lofberg
www.cubedesigners.com <http://www.cubedesigners.com>