Author Topic: Justify Alignment for Text  (Read 37299 times)

vei

  • Guest
Justify Alignment for Text
« on: December 28, 2012, 02:39:25 AM »
Hi, sorry if this question has been asked before.

How can I make justify alignment in UILabel? Can I put it as future feature request?
Thanks a lot!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Justify Alignment for Text
« Reply #1 on: December 28, 2012, 11:59:57 AM »
There is no justify alignment with UILabel, and unfortunately it's not currently on the roadmap.

ManyWorlds

  • Guest
Re: Justify Alignment for Text
« Reply #2 on: February 19, 2013, 11:26:38 AM »
Hi!

I´m currently in the need of having this feature too, I don´t mind implementing it myself, but I will need some advice on how to proceed and what are the suggest steps.

Thanks!

sandolkakos

  • Newbie
  • *
  • Thank You
  • -Given: 16
  • -Receive: 1
  • Posts: 17
    • View Profile
Re: Justify Alignment for Text
« Reply #3 on: February 19, 2013, 04:06:11 PM »
Maybe using different UILabels with different Pivots.
Or also using various UIAnchors, one for each Widget Group.

In my images bellow i used one UIAnchor for each Widget Group.
My technique was used to Sprites, but works pefectly to UILabels too.

vei

  • Guest
Re: Justify Alignment for Text
« Reply #4 on: February 28, 2013, 05:42:00 AM »
I did it before by modifying Print function from UIFont.cs.

Basically it's similar with Align function that's applied when the alignment is not Alignment.Left.
Divide the "extra spacing" left in that particular line by the number of space character.
Then just adjust the x-position of each character's buffer "verts" accordingly with that extra spacing.

basil_11

  • Guest
Re: Justify Alignment for Text
« Reply #5 on: March 14, 2013, 10:47:41 PM »
how can we find the extra line spacing?

It would be a big help for us to know how you did the justification of the Text :)

thank you sir

DCassy

  • Guest
Re: Justify Alignment for Text
« Reply #6 on: July 16, 2013, 07:03:25 AM »
Hello there,

Thanks for clues, but creating text justification in UIFont seems really complicate for a non coder like me... I am so annoyed this function is not integrated in NGUI. Why isn't on the road map ? Any help would be highly useful here.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Justify Alignment for Text
« Reply #7 on: July 16, 2013, 10:47:01 AM »
Because NGUI is not a word processor. It's a game UI system.

DCassy

  • Guest
Re: Justify Alignment for Text
« Reply #8 on: July 16, 2013, 11:26:02 AM »
 Well, I could cite several game that use huge amount of justified text... I could understand if there is a technical difficulty on doing this, but I am a bit surprised by this rude answer. I spent 90 € on your asset, to hear that I am using Unity as a word processor... Bad publicity.
« Last Edit: July 16, 2013, 11:37:52 AM by DCassy »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Justify Alignment for Text
« Reply #9 on: July 17, 2013, 03:58:47 AM »
But that's the thing though, if it was a frequently requested feature, I would see no reason not to add it. I've only had this question asked maybe once every 6 months, which tells me that few games need this feature. I'm a solo developer with very limited amount of time and resources, so I have to focus on higher priority tasks -- such as redoing the font system within Unity itself in order to make it work with dynamic fonts correctly. I don't intend to be rude -- merely realistic.

DCassy

  • Guest
Re: Justify Alignment for Text
« Reply #10 on: July 18, 2013, 04:47:10 AM »
I understand better now. Thanks for your answer.

VapapeurTeam

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Justify Alignment for Text
« Reply #11 on: October 07, 2013, 10:10:43 AM »
Hello,

Sorry for necro'ing an old thread, but I figured it'd be better than creating a new one.

I would also like to have text justification for some UILabels in my game. Texts can look pretty awful if they're a bit lengthy (like more than 2 lines) and not justified properly.

Is it still not planned to add this feature into NGUI ? If not, I completely understand, although if you have suggestions as how you think it'd be done best in your code, I'd be happy to hear them.

Thanks in advance

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Justify Alignment for Text
« Reply #12 on: October 08, 2013, 02:06:33 AM »
Still no plans at this time.

mremus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: Justify Alignment for Text
« Reply #13 on: November 11, 2013, 07:21:18 AM »
I will add my vote for needing text justification/alignment in NGUI.  Working on a sim for the US Navy and as you would guess they like things to line up nicely in the text portion of the sim instructions.

Thanks!

renanse

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 1
  • Posts: 14
    • View Profile
Re: Justify Alignment for Text
« Reply #14 on: November 12, 2013, 04:08:40 PM »
Justify would be very nice.  I've had to mix in another library (TextBox) just so I can do a proper opening crawl in our game.  I would *really* love to replace that with NGUI text instead.