Author Topic: [Solved]Scaling UISprites failed  (Read 1879 times)

Keyjin

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 6
    • View Profile
[Solved]Scaling UISprites failed
« 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.



Thanks :)!

Cheers,
Keyjin
« Last Edit: June 17, 2014, 04:08:53 PM by Keyjin »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling UISprites failed
« Reply #1 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).

Keyjin

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Scaling UISprites failed
« Reply #2 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!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling UISprites failed
« Reply #3 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.

Keyjin

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Scaling UISprites failed
« Reply #4 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!
« Last Edit: June 17, 2014, 04:08:32 PM by Keyjin »