Author Topic: Chat Window with Image  (Read 4432 times)

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Chat Window with Image
« on: January 29, 2013, 03:44:02 AM »
In order to create a full function chat window, I want label can show little pictures for example :
Hi :) hello

However TextList in NGUI can only change the color of texts, but cannot add some other elements such as pictures or hyperlinks.

I tried to create a Sprite to show an image, and calculated the position to cover the text which represent image, but the height of a line cannot adjust for image bigger for characters.

I want to know is there any method to realize a chat window which allow users to insert happy faces  :) like this forum.

And there is another problem, in my font file, there are some large characters which as three times  as the rest, but in Label, they do not have enough space, other characters cover the extra places,  Can some one help to to deal this problem?

Please forgive my pool English. Thank you.
« Last Edit: January 29, 2013, 05:52:19 AM by galuodo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Chat Window with Image
« Reply #1 on: January 29, 2013, 05:52:16 PM »
If only there was a video on how to do this... http://www.youtube.com/watch?v=JbqfK3mU140

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: Chat Window with Image
« Reply #2 on: January 29, 2013, 09:41:42 PM »
Thanks for your replay, this video tutorial can save me a lot of time.

However, this method can only fit with image is the same save of font.If I have a larger image say a square, text of next line will cover this image. So is there a solution?
Please forgive my  questions.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Chat Window with Image
« Reply #3 on: January 29, 2013, 10:41:57 PM »
It's a limitation. Embedding an emoticon means the emoticon ideally must be the same height as the font you're embedding it in. Remember, you are doing text here with custom characters -- not a full-blown HTML layout.

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: Chat Window with Image
« Reply #4 on: January 30, 2013, 12:26:05 AM »
I've read your code and find a solution, your work is powerful.

zilong0007

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Chat Window with Image
« Reply #5 on: December 11, 2013, 07:04:26 AM »
Hi Galuodo,

Can you share your solution?  Our chat window need show little picture also. More diffcultly, it need support Facial animation, Do you have any suggestion?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Chat Window with Image
« Reply #6 on: December 12, 2013, 01:57:58 AM »
If you mean emoticons, NGUI has this built-in. Just check the chat example and type ":)".