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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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.