Author Topic: UILabel's outline effect distance keeps getting reset  (Read 3101 times)

tydygunn

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 20
    • View Profile
UILabel's outline effect distance keeps getting reset
« on: February 21, 2013, 06:31:20 PM »
Hi all!

I'm having a problem in which I'm using a series of UILabels in my scene to act as score indicators when the player completes an action. These labels are parented under a UIPanel and are animated (they scale from 0, 0, 1 to normal size and back again). The panel always stays at (1, 1, 1), I'm only animating the label itself. I want a stroke around the letters and the standard (1, 1) size for outline isn't nearly big enough so I cranked up the effect distance variable to (4, 4). The issue I'm having is that while in game the stroke visibly resets back to what it looks like with a (1,1) stroke even though the inspector claims that the label is still at (4, 4). If I adjust the value in the inspector it seems to kickstart it again and the stroke reappears.

Am I doing anything obviously wrong? The text is almost unreadable without the stroke.

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel's outline effect distance keeps getting reset
« Reply #1 on: February 21, 2013, 10:22:54 PM »
0 is an invalid scale. You can't divide by zero, so you can't calculate an inverse scale. Use a small value instead such as 0.01.

The built-in outline effect isn't very efficient. I don't recommend using it. I suggest baking the outline effect into the font itself in Photoshop.