Author Topic: Rendering text on a path  (Read 2628 times)

[ELine]asilva

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Rendering text on a path
« on: February 05, 2014, 03:02:59 PM »
Hello and thanks for this awesome GUI package!

I have a couple questions regarding rendering text on a path (specifically in an arc).

1. What would be the best way to go about this using NGUI?
2. The algorithm posted in the answer on this page renders the text one character at a time and places/rotates the characters as it goes: http://stackoverflow.com/questions/2803853/how-to-create-curved-text-on-a-bitmap - would this be feasible with NGUI using the built-in text rendering tech?
3. The text geometry would be static once it's been rendered.  Would there be any way to pre-build that geometry with NGUI in the editor and then have it baked out to a mesh when the game is being built?  There will be a lot of it possibly on screen at once - 300-400 strings with an avg. 2-4 words per string when zoomed out.

Any info about where to start or how to accomplish something like this with NGUI would be much appreciated!

Thanks!
-Anthony

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Rendering text on a path
« Reply #1 on: February 05, 2014, 03:14:09 PM »
NGUIText.Print function lets you print characters into VBOs, and that's what UILabel uses in its OnFill() function.

If you want to have curved text like that, your best bet is to create a custom label class derived from UILabel, and overwrite its OnFill() function. You will want to modify the 'verts' list after calling base.OnFill.

[ELine]asilva

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Rendering text on a path
« Reply #2 on: February 05, 2014, 03:18:36 PM »
Thanks for the quick response! 

That should get me started.  I will post back here if I run into any issues.