I'm working on unity3D project. It contains a chat part. In this chat users might & probably will use emojis in chat. My first problem is emojis are not being displayed in textfield which after searching for one day & more didn't find a proper solution. Second problem is lets assume those emojis are now display I'm not able to save them in mysql database knowing that I used utf8-mb4 for the databse, table & the column in which message is saved in. Have anyone find a solution to display & save emojis in Unity3D?
Asked
Active
Viewed 1,516 times
1 Answers
1
You need to write a function to convert message text to a GameObject which is composed of sub-texts and emoji-images.
public GameObject convertStringToGameObject(String a_Text);
for example if your text is : "Hello :) World :P"
than you can create 2 text writing "Hello"
and "World"
after that you can detect the emoji types and select corresponding texture for your rectangle.
There will be root GameObject that contains your sub GameObjects which can be either text or image which are ordered according to your original text.
For storing emojis, I can suggest to use a Texture Atlas so you can just hold texture coordinates for your emojis inside your DB.
To store the messages of users (messages with emojis), just save text representations of emojis instead of storing the image each time.

Berke Cagkan Toptas
- 1,034
- 3
- 21
- 31