Well ofcourse it can be my own weird code, but let me beleive it is not for now.
So I am trying to change the size of a drawn texture2D over time.
Within the OnGUI function I do this:
Rect area = new Rect(0,0,x,1024);
GUI.Label(area, originalTexture,“”);
Note:
Within the class scope:
public Texture2D originalTexture;
I change the ‘x’ variable in the update function from 0 to 117 (with a Mathd.SmoothStep function).
My problem is, the image is not drawn with the constant 1024 height, instead it changes from 0 to 1024!
So it seems that if I use GUI.DrawTexture instead of GUI.Label, I do get the result I want, and that is streching the image only towards one direction.
However, in an application I use many of these calls and I get alot more draw calls when using DrawTexture instead of Label.
Am I correct to say, that when the size of the rectangle used is 0 in width and height, the DrawTexture is still done, while the Label is not actually done, resulting in much more draw calls when using DrawTexture?
I did that, but obviously you don’t need this check when using GUI.Label, so I’m guessing that if I actually did this check even when only using GUI.Label, I would be doing a check that was already done (as GUI.Label of zero size does not produce a draw call).