Author Topic: NGUI Atlases creation at runtime using image (png) file.  (Read 2222 times)

dipu5683

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
NGUI Atlases creation at runtime using image (png) file.
« on: June 06, 2014, 01:42:04 AM »
Hi

i want to create a ngui atlases at the runtime for the png image file. In our game some of the image file will be stored at the server end. At run time i have to download them , & display them. i am ngui sprite.
Can any body help?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Atlases creation at runtime using image (png) file.
« Reply #1 on: June 06, 2014, 02:42:05 AM »
Can you? Sure. But it will require code on your part. You will need to know where all the sprites are in that texture, meaning this data has to come from somewhere. Assuming you have the texture and the sprite information, creating an atlas itself is simple. Just populate UIAtlas's spriteList.

dipu5683

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: NGUI Atlases creation at runtime using image (png) file.
« Reply #2 on: June 06, 2014, 04:37:10 AM »
the png file itself is a single sprite. which is uploaded on to server. i will download this image & create a atlas at runtime.
which will finally apply to any uisprite.