Author Topic: Facebook(ProfilePic.www) Integrated into NGUI UITexture  (Read 2863 times)

Chaz32621

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Facebook(ProfilePic.www) Integrated into NGUI UITexture
« on: January 22, 2016, 10:28:58 AM »
So this has been very annoying I have spent hours trying to get this working. Nothing!!

I have a UIRoot which has buttons and such and also a UITexture this UITexture is for that of the FB ProfilePic. I am using a 3rd party api call instead of using FB sdk. However I still in the logs get the link of the profile pic.(www.....) and if I put that like in my browser it shows me the user who is logging in profile pic. However for some reason it does not show up on my game.

If I add a UITexture to it I can see it before I log into facebook. So before I log in I just have some random texture I added after I log in(Which should show my profile pic) I get nothing its blank.

Maybe my code is bad??

I am using Mobile Social Plugin as well from the store.


  1.  SPFacebook.OnUserDataRequestCompleteAction -= UserDataLoaded;
  2.         if (result.IsSucceeded)
  3.         {
  4.             Debug.Log("User Data Loaded!");
  5.             IsUserInfoLoaded = true;
  6.             SPFacebook.Instance.userInfo.LoadProfileImage(FB_ProfileImageSize.normal);
  7.             string FBNametxt = SPFacebook.Instance.userInfo.Name;
  8.             UILabel Name = GameObject.Find("FBName").GetComponent<UILabel>();
  9.             Name.text = FBNametxt;
  10.             //Texture2D FBLoadPicture  = SPFacebook.Instance.userInfo.GetProfileImage(FB_ProfileImageSize.large);
  11.             UITexture FBLoadTex = FBGetProfile.GetComponent<UITexture>();
  12.             FBLoadTex.mainTexture = SPFacebook.Instance.userInfo.GetProfileImage(FB_ProfileImageSize.normal);
  13.           //  FBLoadTex.MakePixelPerfect();
  14.         }
  15.         else {
  16.             Debug.Log("User data load failed, something was wrong");
  17.         }

Please help!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Facebook(ProfilePic.www) Integrated into NGUI UITexture
« Reply #1 on: January 25, 2016, 10:26:23 PM »
Unfortunately I am not familiar with the facebook plugin you are using, so I can't comment on it. Setting the "mainTexture" on the UITexture should be enough to change it. Just have a look at the DownloadTexture example script that comes with NGUI.