Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Markov on October 11, 2013, 03:00:21 PM

Title: UIStretch problems after migrating to 3.0.2
Post by: Markov on October 11, 2013, 03:00:21 PM
http://www.youtube.com/watch?v=ECFzVpIYXwM&feature=youtu.be (http://www.youtube.com/watch?v=ECFzVpIYXwM&feature=youtu.be)

UIStretch doesn't work now. I tried to put it on the same GameObject with widget and on a parent of widget.
If I put UIStretch on parent - it multiplies scale of transform on every OnValidate event(i guess).
If I put it on the same object it doesn't do anything.
Title: Re: UIStretch problems after migrating to 3.0.2
Post by: ArenMook on October 12, 2013, 09:12:41 AM
Remove the "container" property. Why did you set it? You set the parent's container to be the child. Uh.

Keep the stretch on the sprite. Don't put it on the "BG" object.
Title: Re: UIStretch problems after migrating to 3.0.2
Post by: Markov on October 18, 2013, 04:46:13 AM
Oooops ;D
So, I have new question. UIStretch doesn't work correctly if the camera is in perspective mode.
It works fine  if my background object right in the camera position, but if I move bg sprite position back - it won't cover all background space.
Title: Re: UIStretch problems after migrating to 3.0.2
Post by: ArenMook on October 18, 2013, 05:23:57 PM
It's not meant to. Orthographic cameras have a fixed width and height. Perspective cameras have a varying width and height based on the depth.
Title: Re: UIStretch problems after migrating to 3.0.2
Post by: Markov on October 18, 2013, 06:56:42 PM
So is there any way to use UIStretch in perspective camera?
Title: Re: UIStretch problems after migrating to 3.0.2
Post by: ArenMook on October 18, 2013, 06:59:27 PM
You can't use a perspective camera's bounds, no.