Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: sonicviz on June 06, 2014, 10:26:51 AM

Title: NGUI 3.6.2 Stretch a sprite full screen
Post by: sonicviz on June 06, 2014, 10:26:51 AM
Hi,
I've watch the tutorials but still can't figure out how to replicate the simple case of stretching a sprite horizontally and vertically so it will be locked as a panel background no matter what screen size.

I understand how the new anchoring works but the new stretch is head scratching.

clues?
Title: Re: NGUI 3.6.2 Stretch a sprite full screen
Post by: travisschau on June 06, 2014, 11:16:53 AM
Set the Anchors to your sprite to unified, and set Left to Target's Left, Right to Target's Right, Bottom to Target's Bottom, and Top to Target's Top. Then set each number to 0.

That anchors it to all sides and stretches the image to match your view.

Should look like the screenshot attached.
Title: Re: NGUI 3.6.2 Stretch a sprite full screen
Post by: Darkmax on June 06, 2014, 01:41:21 PM
Just a question how can I stretch a sprite, but not anchor to the screen, for example I want a sprite to stretch 2/3 on both sides(horizontal and vertical) but move it freely (not anchor it).
Title: Re: NGUI 3.6.2 Stretch a sprite full screen
Post by: Nicki on June 06, 2014, 02:12:18 PM
Darkmax, for that I'd use the old UIStretch as the new system doesn't really support that as it is. :(
Title: Re: NGUI 3.6.2 Stretch a sprite full screen
Post by: ArenMook on June 06, 2014, 09:50:20 PM
Why not, Nicki? NGUIMath.MoveRect lets you move it around freely, even if it's anchored.
Title: Re: NGUI 3.6.2 Stretch a sprite full screen
Post by: sonicviz on June 06, 2014, 10:11:44 PM
TY!
Title: Re: NGUI 3.6.2 Stretch a sprite full screen
Post by: Nicki on June 10, 2014, 12:27:03 PM
Aroo, I need to mess more with the new anchors I gather.