Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: fork8 on September 24, 2012, 07:42:52 AM

Title: Combine several textures and set result texture to UISprite
Post by: fork8 on September 24, 2012, 07:42:52 AM
Hi there.
I need to combine several textures of different widgets and set result texture to UISprite or UITexture.
What is the best way to get textures from several SlicedSprites or atlases, process them in script and put back for draw with SlicedSprite?
Little example plz.
Title: Re: Combine several textures and set result texture to UISprite
Post by: ArenMook on September 24, 2012, 08:29:48 AM
The obvious question is -- why are you trying to to do this, and also what do sliced sprites have to do with any of this?
Title: Re: Combine several textures and set result texture to UISprite
Post by: fork8 on September 24, 2012, 12:04:56 PM
I need to change "pixel by pixel" in texture for changing colors by mask(another texture) and output(draw) result to UITexture.
You are right, i do not need SlicedSprite.  Now a have another complication - when looping the texture "pixel by pixel" and change it color to needed, it seems that result is saved to assest directory and when i push play button - program started with already modified texture ))) Sorry for stupid question and english and answer please - haw i must menage textures(UITexture) correct?

Here is how i set modified texture: pat1.mainTexture = texMosaic;
Title: Re: Combine several textures and set result texture to UISprite
Post by: PhilipC on September 24, 2012, 02:05:13 PM
I would create a new texture instead of trying to modify the one you already have. Unity saves that sort of modification even if done at run time.
Title: Re: Combine several textures and set result texture to UISprite
Post by: fork8 on September 24, 2012, 02:17:55 PM
Thanks for the reply, i also find it logical, i will try.