Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Multiple Resolution Sprites (HD/UD)

Discussion in '2D' started by a.sami.sdd, Mar 25, 2015.

  1. a.sami.sdd

    a.sami.sdd

    Joined:
    Mar 20, 2014
    Posts:
    2
    I don't have any thing implemented for this yet. But i have 2 resolutions of sprites extracted from texture packer

    Assets/Sprite/HD/Gamesheet.png (100 Pixels per unit/Mipmaps Off)
    Assets/Sprite/UD/Gamesheet.png (200 Pixels per unit/Mipmaps Off)

    Now I can replace these files back and forth in editor to get the resolutions required.
    Question 1) - Can I do the switching runtime before textures get loaded based on device resolution.

    If No this should have been a built in feature :(

    Proceeding further i can attach a custom script to all sprite renderer to Change the texture on runtime That of course would cause both HD/UD textures to present in memory which is bad.

    I can remove default sprite and only load required sprite but in this case i won't be able to see any sprite in editor that i guess would be a pain for a game within constant development. Any Thoughts on this?

    Even If i can manage that not seeing any sprite in sprite. How can i handle this with my Animations referencing sprite changes.

    That I guess could be done by creating a custom float variable in my custom script and changing it from Animation (adding frame for float var) and load sprite based on that custom float index to search my sprite list and change the image. That would of course lead to going blind even without stick. I think that would be hard to manage the game source. Any Thoughts on this also.

    Also, I'm looking for a solution within unity. I can't use 2D Toolkit as i will have to change all sprite renderers etc. I guess i haven't used it.
     
  2. SamiSdd

    SamiSdd

    Joined:
    Mar 12, 2015
    Posts:
    11
    WoW. No Answer Yet!!
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,992
    Not sure if it helps, but this video had some sd/hd switch mentioned (and example scripts in the description link)
     
  4. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377