Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: aliasif452001 on April 27, 2016, 10:52:46 AM

Title: Changing Material of UI2dSprite or UITexture At Runtime
Post by: aliasif452001 on April 27, 2016, 10:52:46 AM
Hello . I am trying to change and alter material of ui2dsprite and UItexture during runtime . It seems normal UItexture.material doesn't work i tried access UItexture.DrawCall.basematerial but it gives me null exception  . I can not think of any other way to do this . Any idea how i can do that ?

Thanks
Title: Re: Changing Material of UI2dSprite or UITexture At Runtime
Post by: ArenMook on April 28, 2016, 02:32:17 AM
Set the sprite's onRender delegate. When it's called, it will pass a Material that you can then do what you want to that material.
Title: Re: Changing Material of UI2dSprite or UITexture At Runtime
Post by: aliasif452001 on April 29, 2016, 01:56:05 PM
Thanks it worked