The Organization

Cool Unity3d Text Format Trick

When displaying a players stats, you sometimes want to line up all the stat names, and also line up all the values. This has typically required two text fields, so you can align both of them. This is a bit of a pain in the ass. I found this forum post which explains a clever way to left and right align text in a single text field. You can also use the <line-indent=xxx> in place of the <align=right> to get multiple left-aligned columns of text. Thus saving yourself an extra text field. Bonus points if you are using some kind of binding system, so you can have all the string-formatting in a single place.

I am going to also paste the rich-text formatting here, in case the forum post goes away.

<align=left>This is the left aligned text<line-height=0>
<align=left>This is the left aligned text<line-height=0>
unity3d permalink


"Planck length is about E-35 m; a human is about E0 m, a ratio of 35 orders of magnitude. The size of the observable universe is E27 m, or 27 orders of magnitude difference. That means the difference between a human and the Planck size is 100 millions times larger than the difference a person and the entire universe!" William Stoertz

Was thinking about this today, and the scope of how much space is "inside" us, versus how much space is "outside" us. I did not realize the scale of difference between the two. Obligatory link to Kurzgesagt's video on this.

science permalink