Hello Guest

Author Topic: Getting/Changing SpriteCollection by string, possible?  (Read 3990 times)

MildMania

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Getting/Changing SpriteCollection by string, possible?
« on: October 10, 2014, 08:11:57 pm »
Hello,

I want to change spritecollection of sprite by giving string as parameter? Like .SetSpriteCollection("MyCollection5") is such thing possible?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting/Changing SpriteCollection by string, possible?
« Reply #1 on: October 10, 2014, 09:18:25 pm »
No it isnt, but you can put the sprite collection data object in a resources folder and use Resources.Load to load it and SetSprite(loadedSpriteCollection, "spriteName");