Author Topic: Font misalignment with NGUI 3 for negative Y line spacing  (Read 2889 times)

neilb

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Font misalignment with NGUI 3 for negative Y line spacing
« on: October 13, 2013, 11:46:08 PM »
I've noticed that if a label has the following properties:
  • a vertical center pivot point
  • overflow set to resize content
  • one line of text
  • a font with a negative vertical spacing (to pack lines together)
then the label text will be offset towards the bottom of the label container.

Changing the vertical pivot to top will move the text back to the approximate vertical center of the label.

To demonstrate the problem with the way it's being handled now: a label placed approximately in the vertical center of a button, with a top pivot, will appear to be offset towards the top of the box when showing longer strings. If it's given a vertical center pivot, then it will be offset towards the bottom of the button for longer strings. A vertical bottom pivot will put the text outside the boundary of the label.

NGUI 2 behaviour with a single line of text was to vertically center align it, if the pivot was centered.

Thanks