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.

UI elements stuck - need refresh

Discussion in 'UGUI & TextMesh Pro' started by mog-mog-mog, Sep 20, 2014.

  1. mog-mog-mog

    mog-mog-mog

    Joined:
    Feb 12, 2014
    Posts:
    266
    1) Image - using FILL type. In update , update image fill from 0-1 and then again 0-1.
    After 1st cycle, it'll stop showing image, unless object is refreshed (deactivate and activate)
    2) Grid control with multiple inner items. Deactive/Activate inner grid items. Grid will show gaps and items will not be aligned in line. If I refresh the grid by deactivate the grid, it'll auto realign the items again. Is there a better way to refresh the grid realignment rather than deactivating and activating again in the end of frame.
     
  2. adhdchris

    adhdchris

    Joined:
    Nov 13, 2013
    Posts:
    45
    Not sure if this is the right way but Image.SetAllDirty() seems to work with FILL images.
    I haven't tested it with a grid, but I'm guessing either SetAllDirty() or SetLayoutDirty() should refresh the grid too.
     
  3. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,165
    This should be fixed in b18, are you still using b17?
     
  4. mog-mog-mog

    mog-mog-mog

    Joined:
    Feb 12, 2014
    Posts:
    266
    Yes, I am still on B17. Now, I am on my way to 18 :)
     
  5. mog-mog-mog

    mog-mog-mog

    Joined:
    Feb 12, 2014
    Posts:
    266
    Image refresh works well on 19, but ui grid does not refresh if inner items become enable/disable. What's the suggested way? Grid/Canvas/scrollrect does not inherit from Graphic, so it does not expose dirty methods.
     
    VivienS likes this.
unityunity