Author Topic: Programmatically change Atlas texture  (Read 6014 times)

kwelts

  • Guest
Programmatically change Atlas texture
« on: July 11, 2012, 09:48:45 AM »
Hi,

So I'm attempting to swap atlas textures for a button. I have tried to use "NGUITools.ReplaceAtlas(UIBaseAtlas "x", UIBaseAtlas "y");" but mono develop can't seem to locate the Atlases when i type them in. Is that the proper way to swap Atlases?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Programmatically change Atlas texture
« Reply #1 on: July 11, 2012, 01:45:42 PM »
That function has been marked as obsolete months ago. You need to use the replacement field on the atlas. There is a video tutorial for this, and quite a few posts on this forum as well.

kwelts

  • Guest
Re: Programmatically change Atlas texture
« Reply #2 on: July 11, 2012, 03:48:23 PM »
thanks very much for the response? Could you please link me to the video tutorial? cant seem to find it.

PhilipC

  • Guest

kwelts

  • Guest
Re: Programmatically change Atlas texture
« Reply #4 on: July 12, 2012, 10:06:39 AM »
so i was looking at the tutorial and it didnt say how to do it programatically (thanx for all those tutorials by the way, ive watched so many of them). I was looking ot the NGUITools API and in the replacement field i dont know what to put in the get and set areas.

I assume im getting my new atlas and setting it to my reference atlas, but I cant find out anywhere how to call it properly. Mono develop doesnt seem to know that they are in my project tab.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Programmatically change Atlas texture
« Reply #5 on: July 12, 2012, 10:24:58 AM »
Doing a simple search on the forums for "reference atlas" reveals quite a few topics. For example:

http://www.tasharen.com/forum/index.php?topic=41
http://www.tasharen.com/forum/index.php?topic=830
http://www.tasharen.com/forum/index.php?topic=832

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Programmatically change Atlas texture
« Reply #6 on: July 12, 2012, 10:34:23 AM »
Btw, I noticed by default when you do a search via the top-right widget, it doesn't show all the results, only very recent ones... but if you click on the Search button (top left, between "Help" and "Profile"), it will search properly.