Author Topic: How to load textures in atlas programmatically in editor.  (Read 3932 times)

ciberus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
How to load textures in atlas programmatically in editor.
« 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to load textures in atlas programmatically in editor.
« Reply #1 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.