Hello Guest

Author Topic: Updating Sprite Collection Texture  (Read 4767 times)

st33d

  • Newbie
  • *
  • Posts: 3
    • View Profile
Updating Sprite Collection Texture
« on: June 25, 2014, 12:04:39 pm »
I've built an auto-tiling system for my game - it chooses the right corner and straight tiles depending on its neighbors and constructs a string to request the right name of the tile.

However, now I need to update the sprite sheet with changes to the graphics. We are going to have to do this a lot throughout the lifetime of the project because graphics affect a game's usability. How do I do this without erasing all the names I have given to the tiles? It seems I can't update the sprite sheet at all without destroying all references and spending a day typing in the names of all the tiles so the auto-tiling code can find them again.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Updating Sprite Collection Texture
« Reply #1 on: June 25, 2014, 10:12:51 pm »
Hmm... how exactly are you going about this? Are you constantly resizing the texture / changing the number of rows / layout? If you dont do any of that, and simply create all the sprites required and leave them there, you should be able to simply change the texture as you need to, without any problems.

st33d

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Updating Sprite Collection Texture
« Reply #2 on: June 26, 2014, 10:27:26 am »
Well I tried various things. I gathered that resizing doesn't help.

But when I made a simple change to the texture and tried dragging it back in, I had two textures in my assets folder. I tried setting the texture source to the new texture, pressing commit or whatever and it wouldn't change the texture - nothing appeared to have happened. When I went into the config the only option I seemed to have is to re-dice the texture which updates the sprites but erases all of their names.

It won't let me change the texture it seems. It just sticks with whatever texture that was there when I pressed Apply in the Config panel for the sprite collection.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Updating Sprite Collection Texture
« Reply #3 on: June 26, 2014, 09:15:07 pm »
Ok. Why are you dragging it back in? Our normal workflow is to just save over the file, or just use the PSD to start with and simply save. The sprite sheet importer will not update the links to existing sprites when you chagne the texture for a few different reasons, but thats easily changed if necessary, but I'm not sure I understand why you're reimportnig a new texture every time you change it..

st33d

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Updating Sprite Collection Texture
« Reply #4 on: June 27, 2014, 10:24:57 am »
My coworker has talked me through replacing textures for Unity's standard 2D system now. I see the problem:

Things can't be copied over in Unity Land. They have to be replaced in the operating system environment. Unity point blank refuses to let anything overwrite with the same name. Given how buggy the IDE is on Windows, this is probably for the best.

I copied over my files in my Textures folder and everything updated fine. I get it now - it's just a bit weird after using Flash where the IDE is the only place anything can be changed.

Thanks for your help.