2D Toolkit Forum
2D Toolkit => Support => Topic started by: RakeshChatra on October 11, 2013, 06:03:04 pm
-
HI, I am trying to send the input text which i enter in the input space and sending it to the server to display the chat.. but then if i again enter the text in the text input the previous text is displaying along with the current text.. Please help me to clear the text one used..
-
How are you clearing it?
-
I am setting it to null once used.. string strigtoedit = " ";
-
Setting what exactly, the text mesh or the textinput?
-
string stringtoedit = chatinput.text;
here chatinput is the tk2dTextMesh.. after sending the msg i am making the stringtoedit = " "; setting it to null.
-
You should set it on the tk2dUITextInput.Text. You should be reading the values from that too, if you aren't already. The text mesh simply displays the text on the textinput.
-
i am not able to get it.. tk2dUITextInput.Text should be set to what ?? like i have declared chatInput as a tk2dTextMesh instead of this u want me to declare chatInput as tk2dUITextInput ??
-
You're using the text input, correct? So read and assign textInput.text, don't read directly from the textmesh. The textInput updates the text on there.
-
Public tk2dTextMesh chatInput;
string stringToEdit;
if(chatInput.text!="")
{
stringToEdit = chatInput.text;
Debug.Log("stringToEdit.."+ stringToEdit);
string encodedText = WWW.EscapeURL(stringToEdit);
SendChat(encodedText);
}
chatInput.text = "";
stringToEdit ="";
chatInput.Commit();
this is my code here can you please tell me what changes should i make :)
-
Surely that chat INput text mesh is linked to the tk2dUITextInput?
Basically, do what i've been telling you in the past 2 posts.
use tk2dUITextInput chatInput instead of the textmesh.
-
thank you that solved my problem...:):) and sorry for repeatedly asking the samething..