Author Topic: UISprite : Scale Suggestion Advice  (Read 1800 times)

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
UISprite : Scale Suggestion Advice
« on: June 17, 2014, 11:11:55 PM »
Just a suggestion but, I think it would be better to name the UISprite "Dimensions" to "Width/Height".

Now that it is also definied as part of the Widget, I think this is a great addition. However, being an old NGUI user I remember the days when the Unity scale defined the size of the sprite.
Coming back to the UI recently, the first thing I do is transform.LocalScale and then my sprite is absolutely massive.

Then when I try to find the "Dimensions" the first thing I come across is

.drawingDimensions

I debug it and of course, there it is, the second half of the Vector4, so I try and set that and get a readonly error. I search a bit further and then I find .localSize, this appears to be what I am looking for, but I set this with a new Vector2 and again, a readonly error.

Eventually I stumble across .width and .height and sure enough changing these paramaters is what I am looking for. But finding them doesn't seem intuitive.
But I can't help feeling that is the naming of some of these variables .GetLocalSize would help programmers like myself from having to hunt around.

Why does .localSize even exist anyway, why not just use .width and .height?

Anyway, hope this doesn't sound like a rant. Just something that freaked me out a bit just now when trying to do something I have been used to doing. :)
« Last Edit: June 17, 2014, 11:20:17 PM by ENAY »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISprite : Scale Suggestion Advice
« Reply #1 on: June 18, 2014, 03:39:53 PM »
Consistency with localCenter and localCorners -- that's pretty much the only reason.