Hi,
I want to resize/rotate (here a button) when I click on a button.
How to have the Id of the control to resize ? I tried the following code but the “Big btn” doesn’t appear.
Furthermore, if the modification of the matrix is inside the IF block, the scale of the GUI is not affected. It works if the matrix modification is above the IF block.
void OnGUI()
{
if (GUI.Button(new Rect(10,90, 200, 40),"Expand"))
{
Vector3 offset=new Vector3(0.0f,0.0f,0.0f);
Quaternion rot=Quaternion.Euler(0.0f,0.0f,0.0f);
Vector3 scale=new Vector3(2.0f, 2.0f, 2.0f);
GUI.matrix=Matrix4x4.TRS(offset, rot, scale);
GUI.Button(new Rect(100 , 80, 200, 40),"Big Btn");
}
else
{
GUI.Button(new Rect(40 , 20, 200, 40),"Small btn");
}
}
Thanks for help