Author Topic: How to get screen position between two words in UILabel?  (Read 5133 times)

amaranth

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
How to get screen position between two words in UILabel?
« on: December 31, 2013, 09:03:40 PM »
I'm trying to figure out how to build a string with images in it. I have everything working, except that I don't know how to get my image to show up in the right place.

The string: "Open your journal to see your quests."

The question: I need to insert an image between "your" and "journal". I believe I need to get the screen coordinates between these two words, but I'm not sure how to do this.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to get screen position between two words in UILabel?
« Reply #1 on: January 01, 2014, 07:35:44 PM »
Inserting an image between two words? Create an emoticon on your font using a specific sequence of characters, such as "[J]", and reference a sprite. This implies you're using bitmap fonts. If not, use NGUIText.PrintCharacterPositions (after calling label.UpdateNGUIText()).