Author Topic: doesn't load image in uitexture android  (Read 3883 times)

eliascanaza

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
doesn't load image in uitexture android
« on: July 22, 2014, 03:30:06 PM »
Hi everyone, I have a problem with to load a texture, and i dont know why.

I want download many images from internet and put in UITexture directly and its work fine in editor but this doesn't work in android, I tested many ways and nothing

With this code I create a GameObject with necessary script

  1. _objectPicture = _createGUI.GUIObject("Photo_"+i.ToString(),new float[]{_position, 0 ,0},new float[]{10,10,1},ContainerPhotos);
  2.                         _texture = _objectPicture.AddComponent<UITexture>();
  3.                         _objectPicture.AddComponent<DownloadPhoto>().url = Constants.LinkDownloadPhoto+N["images"][i];
  4.                         _objectPicture.AddComponent<UIDragPanelContents>();

And with this script i download the image from web but before it shows the preloading image and then the photo

  1. void Start() {
  2.  
  3.                 _texture = GetComponent<UITexture>();
  4.  
  5.                 _texture.mainTexture = (Texture)Resources.Load("images/Logo") as Texture;
  6.                 _texture.MakePixelPerfect();
  7.  
  8.                 StartCoroutine(DownloadImage());
  9.         }
  10.  
  11.         IEnumerator DownloadImage() {
  12.  
  13.                 WWW www = new WWW(url);
  14.                 yield return www;
  15.  
  16.                 _texture.mainTexture = www.texture;
  17.                 _texture.MakePixelPerfect();
  18.                 gameObject.AddComponent<BoxCollider>();
  19.                 gameObject.transform.localScale = new Vector3(534,388,1);
  20.         }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: doesn't load image in uitexture android
« Reply #1 on: July 22, 2014, 10:58:18 PM »
Sorry but free version of NGUI doesn't come with any kind of support. It's simply too different from the current latest version. Scale is not used, there is no such thing as DragPanelContents, and other functionality differs as well.

eliascanaza

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: doesn't load image in uitexture android
« Reply #2 on: July 23, 2014, 06:42:25 PM »
my version of NGUI is 2.2.6 and i have this problem ... i need solution for that please

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: doesn't load image in uitexture android
« Reply #3 on: July 27, 2014, 02:58:40 AM »
My answer still stands here. NGUI 2's support has ended quite a while ago. NGUI 2.2.6 is from 2012. There is no way for me to support something that old.