Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ciberus on October 13, 2015, 03:54:06 PM

Title: How to load textures in atlas programmatically in editor.
Post by: ciberus on October 13, 2015, 03:54:06 PM
Hello, can u explain how to load textures in atlas programmatically in editor. I have JSON file from which i'am parsing path to my textures(in editor), but i need to load them into atlas (not runtime) and use them from code, how to?
Title: Re: How to load textures in atlas programmatically in editor.
Post by: ArenMook on October 14, 2015, 09:50:29 AM
Are you asking how to create an atlas at run-time? My question would be why you need to do this? If you are just obtaining textures such as user icons or portraits, I suggest displaying them as-is. Atlases are for bundling a bunch of small objects together in order to save draw calls.

But to answer your question, look at UIAtlasMaker.UpdateAtlas function. Note that this script is in the Editor folder, so you will want to copy some code over to run-time if you need it.