Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[5.2.1f1] UI Image has no longer a default white sprite with it?

Discussion in 'UGUI & TextMesh Pro' started by IntDev, Sep 23, 2015.

  1. IntDev

    IntDev

    Joined:
    Jan 14, 2013
    Posts:
    152
    Earlier, when I put a Image component, it had a white sprite by default, which I could change the color as I wish. Starting with 5.2.1f1 this is no more. Got many assets broken by that. Image component now seems to inherit the sprite from its parent.

    Raw Image seems to keep the previous behavior though. Should I now use it instead for that purpose?
     
    Last edited: Sep 23, 2015
    SuperNoctiz likes this.
  2. SuperNoctiz

    SuperNoctiz

    Joined:
    Jan 24, 2014
    Posts:
    20
    This happens to me too, also when the image doesn't have a parent, this is what happens when I set the image source to none:
     
  3. andrei_filip

    andrei_filip

    Joined:
    Mar 30, 2015
    Posts:
    7
    Same problem here
    Unity what are you doooiiing? Last few patches and releases where really messed up.
     
  4. TrophyManager

    TrophyManager

    Joined:
    Sep 9, 2015
    Posts:
    15
    Same Problem here..
    1 - is this a new behaviour for the Image component (I could not find any information about it in the release notes)
    2 - is this a bug?
    I guess any workarounds are pointless untill we confirm 1 or 2?
     
  5. IntDev

    IntDev

    Joined:
    Jan 14, 2013
    Posts:
    152
    If this is a new behavior (tho I doubt) my workaround is to use Raw Image instead.
     
    vladrybak likes this.
  6. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Having a similar issue, but for some reason I'm seeing the font sprite, even though I don't have any fonts in my project.
     
  7. GordonPang

    GordonPang

    Joined:
    Jan 14, 2014
    Posts:
    3
    I've submitted a bug report on that issue. I'll let you guys know when I get a response.
     
    Devil_Inside likes this.
  8. Snylt

    Snylt

    Joined:
    Jun 29, 2015
    Posts:
    1
    Do you have a link to the issue in the tracker?
     
  9. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    I also have this issue. Where sprites are set to none post-patch, they retain whatever sprite they were last set to. Where they are set pre-patch, they sometimes display correctly, sometimes warp a non-existent sprite into odd shapes.
     
    shkar-noori likes this.
  10. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
  11. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    a link to the bug reported would be nice
     
  12. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    I have a fix for what i think is the bug that i'll get out asap but a bug number would still be good to test against.
     
  13. GordonPang

    GordonPang

    Joined:
    Jan 14, 2014
    Posts:
    3
    "Hey,

    Thank you for submitting a bug to Unity.

    We have identified this issue as a duplicate of an existing known bug and we will be closing the issue. The information you have supplied will help us further in the resolution.

    If you have further questions, feel free to contact us.

    Regards,
    Simonas
    Unity QA Team"
     
  14. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Did you have a bug #? Might have been me who marked it as a duplicate. Tested all the duplicates just to verify.
     
  15. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Did this fix make it into the upcoming patch (5.2.1p2)?
     
  16. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    As i just fixed it a couple hours ago its likely going to miss the cut off for p2
     
  17. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Ok, thanks!
     
  18. debuglog

    debuglog

    Joined:
    Jan 27, 2013
    Posts:
    5
    I reverted the UI dlls to 5.2 and know I can work in 5.2.1p1 with working UI system.
     
    Last edited: Sep 29, 2015
  19. dylan.ryan

    dylan.ryan

    Joined:
    Oct 15, 2012
    Posts:
    29
    hi phil-Unity, do you know if this made it into p2? Also does p2 come out on this friday?
     
  20. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Missed p2 (had a very high priority bug that needed to get in at the same time so focus was shifted). As for p2 its self i think its every friday yes.
     
    shkar-noori likes this.
  21. GordonPang

    GordonPang

    Joined:
    Jan 14, 2014
    Posts:
    3
    Whoops! Forgot to check the forum. The bug is "Case 729687" if you still need it
     
  22. amivarius

    amivarius

    Joined:
    Apr 6, 2015
    Posts:
    2
    I was also affected by this bug and had most of my game look black since I used the no-texture ui image component extensively. I'm glad it got fixed. I hope you guys added some unit tests to make sure it doesn't happen again. Very sorry to hear it doesn't make it into p2 and we have to wait at least another week for the actual working 5.2 release. We reverted back to 5.1 series for now.

    It's somewhat disturbing to realize that you need to wait for 5.2.1p3 to actually start using 5.2 release series.

    Then again - Thank you so much for actually making Unity and providing the free version - I'm really grateful for that. As I have strong background in large enterprise software I can only imagine how hard it is to actually keep up the quality on a project of this scale.
     
    shkar-noori likes this.
  23. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    Additionally to all mentioned cases, I have not just a black texture instead, but my RenderTexture from second top view camera. Looks ugly.
    Also my UI modal panel background changes to that:

    but before it was:


    Changing sprite of Image component to white texture fixed it.
     
    Last edited: Oct 1, 2015
  24. IntDev

    IntDev

    Joined:
    Jan 14, 2013
    Posts:
    152
    Along this bug, image.fillAmount is not working. I have rised this bug 731583 please fix it together.
     
  25. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    I think its fixed as well.
     
    IntDev likes this.
  26. SideEffect_

    SideEffect_

    Joined:
    Jan 27, 2015
    Posts:
    3
    Hello,
    I came across this problem after upgrading to Unity 5.2.1, and have created a quick solution.
    Link
    To use it, click on the "Tools" drop-down near the top, assign the sprite as the white image in the folder, and click "Fix". It will find all images in the current scene (including inactive ones), check if each image has a graphic, and assign the white image if it doesn't.
     
    SAOTA likes this.
  27. lgarczynski

    lgarczynski

    Joined:
    Aug 17, 2015
    Posts:
    9
    Hey, tried your script, you need to add "EditorUtility.SetDirty(image);" in your loop, or the editor doesn't realize change was made and won't save it/update the graphics.

    Here's my updated version, with a source sprite option to allow easy rollback.

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4.  
    5. public class FixImages : ScriptableWizard
    6. {
    7.     public Sprite source;
    8.     public Sprite replacement;
    9.  
    10.     [MenuItem("Tools/Fix Images")]
    11.     static void CreateWizard()
    12.     {
    13.         ScriptableWizard.DisplayWizard<FixImages>("Fix Images", "Fix");
    14.     }
    15.     void OnWizardCreate()
    16.     {
    17.         Image[] images = Resources.FindObjectsOfTypeAll(typeof(Image)) as Image[];
    18.  
    19.         foreach (Image image in images)
    20.         {
    21.             if (image.sprite == source)
    22.             {
    23.                 image.sprite = replacement;
    24.                 EditorUtility.SetDirty(image);
    25.             }
    26.         }
    27.     }
    28.  
    29.     void OnWizardUpdate()
    30.     {
    31.         helpString = "Finds all images in scene without a sprite as the graphic, and sets the graphic as the selected image.";
    32.     }
    33. }
     
  28. Gardosen

    Gardosen

    Joined:
    Oct 25, 2014
    Posts:
    39
    a Unity QA told me that this will be fixed in the next Version.

    Just to let everyone know.

    Greetings
    Gardosen