Hello Guest

Author Topic: Use 2d Toolkit Sprite Collection for everything in game?  (Read 4995 times)

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Use 2d Toolkit Sprite Collection for everything in game?
« on: October 28, 2014, 05:19:27 pm »
I'm liking the platform specific 1x 2x 4x stuff a bunch - it's working great with sprites and fonts.

The game I'm working on targets PC, iOS and Android, so the runtime loading of the appropriate
1x 2x 4x image files is very useful.
 
So I'm wondering if I can get everything that uses a texture in the game to use a texture from
a 2d Toolkit SpriteCollection.

For instance, I've got some Unity particle systems in the game that are using regular Unity textures.
It'd be great if the particle system could instead use 2d Toolkit textures and load the appropriate 1x 2x 4x texture.

Possible?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Use 2d Toolkit Sprite Collection for everything in game?
« Reply #1 on: October 28, 2014, 05:25:34 pm »
Hi,

This isn't possible, all of this only works because of some nasty plumbing work we do with the tk2dSprites, we don't have the same level of control with particle systems and other objects in Unity.

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Use 2d Toolkit Sprite Collection for everything in game?
« Reply #2 on: October 28, 2014, 05:39:17 pm »
Any suggestions (or info you can point me towards) for how to load the load the platform-appropriate size texture for a particle when a scene starts?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Use 2d Toolkit Sprite Collection for everything in game?
« Reply #3 on: October 28, 2014, 05:48:00 pm »
I don't think its even possible with the built in particle system - the issue being you cant specify exact uvs for the particles to use, iirc, it only works with regularly split up textures. You can write code to simply road the correct texture in and replace it at runtime to get 1x / 2x and 4x. Alternatively you can use mipmaps and Qualitysettings to scale down for those things.

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Use 2d Toolkit Sprite Collection for everything in game?
« Reply #4 on: October 28, 2014, 07:13:51 pm »
Thanks - will investigate.