Search Unity

GUI.DrawTexture Flickering. Help is greatly appreciated!

Discussion in 'Editor & General Support' started by EETechnology, May 31, 2017.

  1. EETechnology

    EETechnology

    Joined:
    Aug 15, 2015
    Posts:
    185
    Hello everyone.

    I have been going through a problem for a lot of hours but not able to find the solution. I have a Texture that I have split into chunks. In Editor, I want to display each chunk together to form the new Texture again. But when I try GUI.DrawTexture, for each tile(chunk), you can see some flickering(not correct colors 100%).
    This GUI.DrawTexture Functions are all in a GUILayout.BeginArea(). When I remove this GUILayout.BeginArea(), the flickering is gone.

    My question is : Since I use a lot of BeginArea() functions, is there any restrictions or something I dont know. What should I use best for drawing Textures?

    Thanks in advance.

    (Error shown here : )

    Desktop 05.31.2017 - 19.51.14.01.png
     
  2. Scabbage

    Scabbage

    Joined:
    Dec 11, 2014
    Posts:
    268
    Put all your GUI.DrawTexture() calls into OnGUI() instead.
     
  3. EETechnology

    EETechnology

    Joined:
    Aug 15, 2015
    Posts:
    185
    The GUI calls, all of them, are in OnGUI(), otherwise there would be nothing to see.