Author Topic: problem with UITexture  (Read 1914 times)

Zoid

  • Guest
problem with UITexture
« on: November 14, 2013, 04:37:41 AM »
Hi, I've encountered a slight problem when using UITexture and i haven't been able to figure out why its happening or what I'm doing wrong to cause said problem. So i turn to you guys in hope that you will be able to shed some light on the matter.

The problem is basically that when i change an UITextures material with my facebookpicture material the old texture will somehow still show on the screen(like its burned in / wont clear). Its not an object i can interact with in any way through the unity editor.
the scenes camera clearflags are set to depth only.

I tried changing the texture instead and then it worked as long as i marked the UITexture as changed. But just changing the texture isn't really an option since that would change the texture on anything using that material.

ill paste the basic code snippets where i create the facebook material, and change the UITextures material below.
ill also attach a picture of the problem(the white square left by the right picture is the old texture that doesn't feel like leaving=)).

feel free to ask if I've missed to include some information and ill try to provide it.
appreciate any help you can give me on this =) thanks

//facebook pic material
WWW request = new WWW( anURL );

yield return request;
      
if( request.error != null || request.texture == null )
{
   aCallback(null,false);
    yield break;
}
Shader shader = Shader.Find("Unlit/Transparent Colored");
Material mat = new Material(shader);
      
mat.mainTexture = request.texture;
mat.name = "ProfilePicture";

//this is just simply me changing the material on the texture :P
myUITexture.material = myFacebookPicture.myMaterial;

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: problem with UITexture
« Reply #1 on: November 14, 2013, 03:16:06 PM »
In what version of NGUI? I recall 2.7 had this issue.

Zoid

  • Guest
Re: problem with UITexture
« Reply #2 on: November 15, 2013, 03:17:09 AM »
ah  :-[  thanks for the answer mate!, really sorry for not verifying what version we had, took for granted that we had the latest version.
was not my intention to waste your time with old problems :/ wont happen again!