Author Topic: [Fixed] UITexture and UIPanel clipping  (Read 5484 times)

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
[Fixed] UITexture and UIPanel clipping
« on: August 08, 2012, 11:23:09 AM »
Hi,

Is there a known bug where a UITexture is not clipped using a UIPanel with clipping ?
« Last Edit: August 08, 2012, 01:43:26 PM by nah0y »

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: UITexture and UIPanel clipping
« Reply #1 on: August 08, 2012, 11:24:43 AM »
Seems like it's working if I use the Shared TransparentColored but it's Unlit/Transparent by default

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: UITexture and UIPanel clipping
« Reply #2 on: August 08, 2012, 11:30:10 AM »
And maybe the example in DownloadTexture is out to date now ?
Instead of all the code, we could just do :

  1. WWW www = new WWW(iURL);
  2. yield return www;
  3.                
  4. mText.mainTexture = www.texture;
  5. mText.shader = Shader.Find("Unlit/Transparent Colored");

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITexture and UIPanel clipping
« Reply #3 on: August 08, 2012, 01:43:02 PM »
Yeah, I'll update it.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: [Fixed] UITexture and UIPanel clipping
« Reply #4 on: August 08, 2012, 01:44:25 PM »
And maybe we should have a class, like a NGUIShaderManager that have direct access to the Shaders ?

It will have better performance than doing Shader.Find()

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [Fixed] UITexture and UIPanel clipping
« Reply #5 on: August 08, 2012, 01:47:14 PM »
Unless Shader.Find happens in Update, it really doesn't matter.