Author Topic: sort Atlas by name  (Read 5530 times)

realblues

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
sort Atlas by name
« on: December 10, 2012, 04:02:04 AM »
My Altals has hundres of images,

sometimes images needs to deleted, but this is hard to find in the atlas maker

I need it to be sorted. Is it Possible?

thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: sort Atlas by name
« Reply #1 on: December 10, 2012, 07:40:18 AM »
Believe it or not, sorting an array of strings is ridiculously expensive in C#. I originally had the sprite list sorted, and it was a major source of slowdown when scrolling.

realblues

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: sort Atlas by name
« Reply #2 on: December 10, 2012, 08:36:16 AM »
thanks for reply

I remember that scroll speed. it was horrible :)

If sorting is impossible, how about add searching bar like spritelist view as alternative?

thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: sort Atlas by name
« Reply #3 on: December 10, 2012, 12:25:40 PM »
That's more reasonable.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: sort Atlas by name
« Reply #4 on: December 13, 2012, 04:41:03 AM »
Believe it or not, sorting an array of strings is ridiculously expensive in C#. I originally had the sprite list sorted, and it was a major source of slowdown when scrolling.

Even if you do that only once before display ?!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: sort Atlas by name
« Reply #5 on: December 13, 2012, 05:12:39 AM »
The list of sprites comes from the atlas. This list gets interated through, and you see the string names. Are you suggesting modifying the order of sprites within the atlas itself?

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: sort Atlas by name
« Reply #6 on: December 13, 2012, 05:17:07 AM »
Not just having a List<UISprite> spriteList in your script, and Sort it, then use this list to show the sprites.

realblues

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: sort Atlas by name
« Reply #7 on: February 19, 2013, 11:59:07 PM »
I got one more request..

I need multiple delete. it takes time to delete individually.. may be it rebuild atlas immediately after delete.

Can I expect these 2 features?

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: sort Atlas by name
« Reply #8 on: February 20, 2013, 05:02:37 AM »
Hi,

It's already available, do you have the latest version of NGUi ?