Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - knguyen

Pages: [1]
1
NGUI 3 Support / Emoticons Don't Work With UIInput
« on: July 31, 2014, 01:39:54 AM »
Hey all,

I've implemented some custom "emoticons" (in my case they are just arrow icons pointing in the four directions). These correspond to the keys "<", ">", "{", "}" (I mapped the up and down arrows to the brackets). Everything shows up fine when I modify the label of the UIInput before hitting play.

I read another post that had said that emoticons were disabled on purpose for UIInput. However, I need/want this to work, so can I work around this? I want the users to be able to type in "<", ">" and have the correct arrow emoticon appear, and also have the ability to delete them just like regular characters.

2
Hi,

I have the following code:

  1. IEnumerator Populate(string part) {
  2.   GameObject newItem = (GameObject)Instantiate (ItemPrefab);
  3.                                 UISprite image = newItem.GetComponent<UISprite>();
  4.   image.spriteName = "Head";
  5.                                 image.MakePixelPerfect();
  6.                                 image.width = image.width/4;
  7.                                 image.height = image.height/4;
  8.                                 newItem.SetActive(true);
  9.                         Debug.Log (newItem.transform.position);
  10.                                 newItem.transform.position = new Vector3(1000f,1000f,1000f);
  11.                         Debug.Log (newItem.transform.position);
  12.                         yield return new WaitForSeconds(1);
  13.                         Debug.Log (newItem.transform.position);
  14. }
  15.  

The three debug logs return the following (in order):
(-128.0, 49.0, 0.0)
(1000.0, 1000.0, 1000.0)
(22.6, 3.1, -7.0)

So AFTER the yield (the wait for 1 second), the position of the object is getting updated automatically. If I set the position of the object AFTER the 1 second, the position sticks. Please explain this to me.

Pages: [1]