Author Topic: Using WWW.LoadImageIntoTexture?  (Read 4404 times)

Drexster

  • Guest
Using WWW.LoadImageIntoTexture?
« on: May 15, 2012, 03:20:28 PM »
I'm about to make a "How to play" section for my game and would really like to use hi-res screenshots, however I think storing all of these locally for all the devices would be unwise. Is it possible to use something like "www.LoadImageIntoTexture" with a url to my images in conjunction with NGUI? Obviously I can't update the atlas or anything like that, but what would be the best way to go about this?
« Last Edit: May 15, 2012, 03:54:17 PM by Drexster »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using WWW.LoadImageIntoTexture?
« Reply #1 on: May 15, 2012, 03:21:14 PM »
Just use UITexture to display them.

Drexster

  • Guest
Re: Using WWW.LoadImageIntoTexture?
« Reply #2 on: May 15, 2012, 03:30:58 PM »
Awesome. Thanks...

Couple of questions:
Will this require a unique material for each item? (think scroll view list example 7. In full screen)
and do I simply access the material and update it's texture?



« Last Edit: May 15, 2012, 03:44:33 PM by Drexster »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using WWW.LoadImageIntoTexture?
« Reply #3 on: May 15, 2012, 03:46:20 PM »
Yup, but if you create them dynamically you can just do "new Material(oldMaterial)". Yup, you can change the material's texture at will.

Drexster

  • Guest
Re: Using WWW.LoadImageIntoTexture?
« Reply #4 on: May 15, 2012, 03:54:05 PM »
ok cool. but i guess if they are showing at the same time that wouldn't work, correct? Or i could update once the scroll has settled.... but then their would be the fetching delay. Hmm...


I'm currently testing this out in your example scene 7, and using UITexture causes the depth sorting to break. I'm just placing it on a UISprite object (Unity crashes if you don't remove the UISprite script first, before adding the UITexture script) and changing the material and the sorting no longer works.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using WWW.LoadImageIntoTexture?
« Reply #5 on: May 15, 2012, 03:55:23 PM »
Right, because different material means different draw call, and you need to adjust the Z position to determine what's in front of what.