Author Topic: Combine several textures and set result texture to UISprite  (Read 2508 times)

fork8

  • Guest
Combine several textures and set result texture to UISprite
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Combine several textures and set result texture to UISprite
« Reply #1 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?

fork8

  • Guest
Re: Combine several textures and set result texture to UISprite
« Reply #2 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;

PhilipC

  • Guest
Re: Combine several textures and set result texture to UISprite
« Reply #3 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.

fork8

  • Guest
Re: Combine several textures and set result texture to UISprite
« Reply #4 on: September 24, 2012, 02:17:55 PM »
Thanks for the reply, i also find it logical, i will try.