Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kfboelter on August 22, 2013, 09:12:39 AM

Title: NGUI for the background image
Post by: kfboelter on August 22, 2013, 09:12:39 AM
Hello everyone.

So.. I don't see much about using NGUI for background images, taht should cover the whole device screen.. something like a title screen.
How is that? What is the correct way? Should I use Resources.Load for that, in order to have it dynamically in and out of memory? Or should I use it just as a plain Texture on NGUI? What is best?

Regards
Title: Re: NGUI for the background image
Post by: ArenMook on August 22, 2013, 09:50:03 AM
You can have a UITexture with UIStretch on it set to cover the entire screen, Resources.Load its texture, unload it afterwards. Just note that when you unload, you need to first set the UITexture's texture to null, then wait until end of frame before unloading the resource.
Title: Re: NGUI for the background image
Post by: kfboelter on August 22, 2013, 10:32:58 AM
Ah, it is kind of a mix, then :)

Awesome.
Title: Re: NGUI for the background image
Post by: rur on September 18, 2013, 06:27:15 PM
If you just destroy the game object that was loaded and attached to the Root by AddChild, will that free up the memory also?
Title: Re: NGUI for the background image
Post by: Nicki on September 18, 2013, 09:57:23 PM
Nope. But if you have all references to that removed, then you can call Resources.UnloadUnusedAssets() and it will be freed up. I think there's a direct UnloadAsset as well ( http://docs.unity3d.com/Documentation/ScriptReference/Resources.UnloadAsset.html ) but to be honest, I haven't tried it much so I dunno how that works.