- Home /
Chat Client in Unity
Hi,
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 ?
Regards
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.
Your answer
Follow this Question
Related Questions
How will i get animated gif images in scene? 6 Answers
Creating a texture from pictures and text 0 Answers
gui text button dont work 1 Answer
GUI Skin Custom textures in C# 2 Answers