2D Toolkit Forum

2D Toolkit => Support => Topic started by: Babaganoosh on August 25, 2013, 06:16:16 pm

Title: Sprite Collections Retina Issues
Post by: Babaganoosh on August 25, 2013, 06:16:16 pm
Hey Dinesh,

I'm having 2 sprite collections that aren't responding to the "current platform". I set the current platform in a blank scene before the game loads, and this works for all the other sprites I have. I notice that the sprite collections are defaulting to whatever the tk2d preference menu is set at. Ie if it's set to 1x at editor, and my loading scene changes the platform to "2x" that sprite collection stays at "1x". I've tried rebuilding the 2 sprite collections multiple times, and they change platform fine when I manually set the preference menu.

These two sprite collections are in different folders than the other collections, but nothing else should be different.  Any ideas?
Title: Re: Sprite Collections Retina Issues
Post by: Babaganoosh on August 26, 2013, 08:24:12 pm
Bump?
Title: Re: Sprite Collections Retina Issues
Post by: Babaganoosh on August 27, 2013, 04:56:09 am
Nvm I figured out. I use a separate script to handle the current platform setting, and it was being called after the load level mistakenly. And I guess somehow due to the order stuff awaked, some sprite collections were loading correctly and some weren't. Weird.
Title: Re: Sprite Collections Retina Issues
Post by: unikronsoftware on August 27, 2013, 10:03:33 am
Hey dude, missed your post first time around.  The sprite collection code is set up to run pretty early on, did you change the script execution order on your script to put it in front of the sprite collection stuff?
Title: Re: Sprite Collections Retina Issues
Post by: Babaganoosh on August 27, 2013, 10:42:43 am
Nah I didn't change any script orders. I had one script which changed the current platform on Awake(). And one script which did LoadLevel() on Awake() into a scene using tk2d. How that resulted in only some collections getting affected I have no idea.

I'm assuming tk2d loads everything at once and not asynchronously.
Title: Re: Sprite Collections Retina Issues
Post by: unikronsoftware on August 27, 2013, 11:23:00 am
tk2d loads things when Unity loads it. Its not all at once I can guarantee you that much :D
Definitely put yours in a script order, and make it run before everything. Keep your object in the root of the scene, without any prefabs and you should be more or less guaranteed it'll run before everything else.