Hello Guest

Author Topic: sprite collection not appearing in 'collection' dropdown on tk2dsprite and co.  (Read 5039 times)

semiessessi

  • Newbie
  • *
  • Posts: 6
    • View Profile
Sometimes - for reasons that are mysterious to me - sprite collections don't appear in the drop down for selecting them. The last time I had this I recreated the sprite collection a few times until eventually discovering that an 'empty' (0x00000000 for each pixel) texture I had disabled trimming for (as a lazy way to implement something with no code) was somehow responsible - at least that not adding it to the collection allowed the collection to be selected for use by a tk2dsprite.

I have had the problem since though - most recently a sprite collection which used to appear in that list no longer does and the sprite collection and its underlying textures have not been modified since it was last working... I am skeptical that rebuilding this will fix the problem (it does not - I've tried).

I wonder if there is something subtle I am missing in how to configure these things? I have tried a forum search and browsing the FAQ and have found no similar complaints - so I am guessing this is not likely to be a bug so much as user error.

Any help would be greatly appreciated.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Have you still got that problematic texture? I can investigate that if you'd like me to.

Rebuilding the index doesn't add the sprite collection? If you can wait for a couple days, tk2d 2.1 beta will be released - you will now be able to drag sprite collections into the slot if its not pickable. It might shed some light on the issue.

semiessessi

  • Newbie
  • *
  • Posts: 6
    • View Profile
what do you mean exactly by rebuilding the index? commiting changes to the sprite collection perhaps? i've tried making the same sprite collection from scratch as well as the 'reimport' right click menu option but with no luck.

my 'problem texture' was just 1024x512 empty texture... this one (assuming imgur has not rencoded it) http://i.imgur.com/8ebHhJY.png

it seems odd that i am getting this problem only now and on sprite collection/animation that worked fine in the past. i wonder if i have some bad state encoded somewhere which is screwing things up?

semiessessi

  • Newbie
  • *
  • Posts: 6
    • View Profile
i have managed to work around this by creating a new collection 'foo0' with the same data. checking that i could see that on the dropdown then deleting that and recreating 'foo' now works fine. foo now appears...

i don't know enough about the internals to make any sensible guess about a cause here... its certainly not obvious like in the case where i had the empty texture and i am unfortunately no longer able to reproduce the problem.

i'm /guessing/ that some validation check of some kind failed, or the thing making the atlas failed in some unexpected way but silently (although i can certainly see an atlas texture)... if this is the case I would make the suggestion of failing loudly so the user is aware (e.g. like when sprites are too large to fit in an atlas)

EDIT: FYI my use of the empty texture was with dicing on and trimming off - my hope was that it would create a single small tile of nothing to build the larger sprite from so that i could use them as 'spacers' in some (admittedly fairly nasty) code we have which picks its sprites by index in their collection.

EDIT2: Although note - i still had the same problem with my animated sprite and animation clip/collection which referred to the sprite collection, remaking that fixed that as well.
« Last Edit: July 05, 2013, 02:51:43 pm by semiessessi »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
You don't need empty textures as spacers to keep index consistent. Deleting sprites does not actually change the index numbers, in case you didn't know that.

I'll happily fix the problem or bomb out in an obvious way, but I'm not sure what is causing this...