Author Topic: UILabel shadow offset  (Read 9009 times)

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 71
    • View Profile
UILabel shadow offset
« on: October 03, 2012, 05:01:17 AM »
Hi,

I'm proposing a patch that add the ability to customize an UILabel's shadow offset.
It can be applied over v2.2.1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel shadow offset
« Reply #1 on: October 03, 2012, 07:06:13 AM »
Thanks, but you will already see this feature in 2.2.2 that will be released shortly.

Your patch only affects shadows, and not outline. It defaults to top-right, instead of bottom-right. And for some reason "mLastShadowPosition" is a Color.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel shadow offset
« Reply #2 on: October 03, 2012, 07:12:38 AM »
Oh yeah, and I have no idea what "mTruncate" is.

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 71
    • View Profile
Re: UILabel shadow offset
« Reply #3 on: October 03, 2012, 07:43:24 AM »
Oops, it seems I've made something wired while exporting my patch...

Next one should be the good one ;) !
Edit : Oops again, it will be available in next release, so I won't bother exporting a good patch

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 71
    • View Profile
Re: UILabel shadow offset
« Reply #4 on: October 03, 2012, 08:05:22 AM »
Well, as for the weirdness, we use a local clone of NGUI over which we commit custom changes on a branch that we sync regularly with master.
As I find it quite awful not to use stock code, I started the process of exporting atomic patches of changes that have been made and that could be of any benefit to everyone. I could list them if you'd like to have a look.
Unfortunately, there's a bunch of code review to be performed before submitting patches, since not all (by far) our changes deserves to be kept.

Now, concerning this particular patch :
  - the Color type is due to a merge error (I should I've check before sending  :-[)
  - the mTruncate field is here to allow the display of ellipsis in the case of truncated text. It appears in the patch because this feature has been committed before the shadow one.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel shadow offset
« Reply #5 on: October 03, 2012, 08:43:41 AM »
2.2.2 is out with the modifiable distance feature among others.

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 71
    • View Profile
Re: UILabel shadow offset
« Reply #6 on: October 03, 2012, 09:45:11 AM »
Yeah, thanks !

cky

  • Guest
Re: UILabel shadow offset
« Reply #7 on: November 07, 2012, 01:04:52 PM »
I'm using the shadow offset, and it looks great in the Unity Editor but doesn't render properly when I export it for Flash.  I'm currently using Unity 3.5.6.  Does anyone know if it is supported in Unity 4? 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel shadow offset
« Reply #8 on: November 07, 2012, 02:33:37 PM »
What version of NGUI? 2.2.3 had some fixes regarding colors in flash.

cky

  • Guest
Re: UILabel shadow offset
« Reply #9 on: November 07, 2012, 03:50:56 PM »
This is with NGUI 2.2.3.  The UILabels show up in the Flash build -- I'm just not seeing the shadows.