Hello, I was wondering what the suggestion would be for the best container for a UIAnchor in the following scenario.
We are creating full screen layouts which we want to tween in/out of the scene. These layouts include controls that will anchor to the various edges of the layout based on the screen size. (We are instantiating layouts for the current screen resolution off the screen) If we use the camera as the bounds, we can't instantiate the items off screen and fly them in. The UIPanel requires clipping, which I don't believe we require in this instance, and we don't want to display any widgets as the container.
I have updated the UIAnchor script to allow you to anchor items "relative to the parent" which will anchor items as if they were in the bounds of the screen, but are movable as a whole from the parent object. This works, but I would like to stick to what the library intended.
What would be the suggested approach to accomplish this? Create a UISprite that is the same size as the screen and use it as the bounding rectangle?
Edit: I am thinking of using a simple UIScreenSize class which inherits from UIWidget and has an OnStart() like the following:
void Start()
{
if (uiCamera == null)
{
uiCamera = NGUITools.FindCameraForLayer(gameObject.layer);
}
Rect pixelRect = uiCamera.pixelRect;
this.gameObject.transform.localScale = new UnityEngine
.Vector3(pixelRect
.width, pixelRect
.height, 0
.0f
); }
Thank you,
Dylan