In a chat client like msn or skype we can add emoticons which are inline images in the text. Can we have such a functionality using Unity GUI classes ? If not how do we attain it using lower level APIs ?
Answer by DaveA
Jan 14, 2012 at 01:30 AM
I assume you've seen the chat systems available in the Asset store (a good place to start). A quick and dirty way would be to embed them in the font texture, then detect and convert the text emoticon like ;) to the character code for that symbol in the font texture.
To get fancier, like animated ones, you could either have multiple such characters that you cycle through, or get down-and-dirty with the API to use DrawGUITexture where needed. For that you would need precise font metrics. See GUIStyle.CalcSize and related functions.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
5 People are following this question.
How will i get animated gif images in scene?
Script to make a GUI texture disappear after a set amount of seconds?
Change GUI Texture?
How can I add "..." to GUI.Label if it goes past its bounds?
Text rendering bug. Shows black squares.