- Home /
Graphics.DrawTexture in OnGUI()
Hi, I keep reading in different places if I want to use Graphics.DrawTexture in OnGUI() etc then make sure the event is Repaint. I never read anywhere the alternative places to place this code....placing it in the Update method seems counter-intuitive so can someone tell me a place other than OnGUI?
Answer by whydoidoit · Jul 07, 2012 at 10:22 PM
Do it in OnGUI only when Event.current.type == EventType.Repaint
Ok, I guess I didn't word my question correctly, I have read in various places that If I want to use Graphics.DrawTexture in the OnGUI method, I should do it when the current event is repaint. What I am asking is, what are the other alternatives
You misunderstood my question. I was saying that I have read that if I wanted to use Graphics.DrawTexture inside OnGUI() then I need to make sure the current event is repaint. $$anonymous$$y question is what are the alternative places to put it, what other choice is it implying I have to place it?
In which case no idea - never needed to do it. I imagine it needs to be drawn once per frame so implying a coroutine, or an update function (late, fixed, ordinary) I'd guess.
Your answer
![](https://koobas.hobune.stream/wayback/20220613073841im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
mouse over and change texture 0 Answers
GUI.DrawTexture doesn't obey drawing order in hierarchy? 0 Answers
Graphics DrawTexture C# Does not appear 1 Answer
Graphics.DrawTexture not working after changing quality settings 1 Answer
Mathf.Lerp 2 Answers