Hello Guest

Author Topic: How to set tk2dTextMesh  (Read 4256 times)

larryapple

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
How to set tk2dTextMesh
« on: June 23, 2013, 03:58:44 am »
Sorry to keep stumbling over basic issues. I have a login text input, which works fine. Then I want to display the logged in user name. So I have a tk2dUIItem with a tk2dTextMesh child. Your docs say that the text mesh has a Text field, which I want to set with the user name. But if I define a tk2dTextMesh variable, I can't drag the text mesh child to it to make it accessible in my script. So I define a tk2dUIItem, but then how do I find its text mesh child?

Then I want to populate the lobby list of games from the SmartFox server, and then be able to click on one and retrieve the user name. Do you have any sample code or snippets for this kind of thing?
« Last Edit: June 23, 2013, 04:51:05 am by larryapple »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to set tk2dTextMesh
« Reply #1 on: June 23, 2013, 11:21:48 am »
Why do you need a tk2dUIItem if all you want to do is display some text?
Simply drag a textmesh in, and set the text directly to the text mesh.
http://unikronsoftware.com/2dtoolkit/doc/2.00/tutorial/scripting_a_text_mesh.html