Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Keyjin on June 16, 2014, 03:43:04 PM

Title: [Solved]Scaling UISprites failed
Post by: Keyjin on June 16, 2014, 03:43:04 PM
Hey guys,

i have the problem, when i scale an object down it moves out of the "UISprite" Box Size.

(http://up.picr.de/18638851if.jpg)

Thanks :)!

Cheers,
Keyjin
Title: Re: Scaling UISprites failed
Post by: ArenMook on June 17, 2014, 12:56:29 PM
Your sprite size is 970, but you've shrunk it down to 0.1% of that, or less than a pixel in size. What for? Keep the scale at (1, 1, 1).
Title: Re: Scaling UISprites failed
Post by: Keyjin on June 17, 2014, 01:32:00 PM
Ok. I made a script to scale the Objects to the given Screen Format.
Example. From 10:16 to 2:3

  1. GmObj.transform.localScale = new Vector3 (GmObj.transform.localScale.x * (2 / 10), GmObj.transform.localScale.y * (3 / 16), GmObj.transform.localScale.z);
  2.  

How can i scale to the needed format ? Need that for Mobile Devices!
Title: Re: Scaling UISprites failed
Post by: ArenMook on June 17, 2014, 02:12:35 PM
Bad idea. You're skewing the sprite. Skewing the UI is a terrible idea as it makes everything look ugly and blurry.

Don't do it. Use the options on the UIRoot. It has a "Shrink Portrait UI" option.
Title: Re: Scaling UISprites failed
Post by: Keyjin on June 17, 2014, 02:27:28 PM
Oh Thank you :)! Works perfect !!

Is it possible to set the Max Width for "Shrink Portrait UI"? Because i want to make it for mobile and PC.

Edit: Solved.... Must read more the documentation ... sry for the stupid question!