Hi all
I was trying to use RotateAroundPivot on the GUI which works but only once in a GUI, someone suggested a matrix, but i didn’t understand. So instead I am thinking of having more than 1 GUI, is this possible
Thanks
Michael
Hi all
I was trying to use RotateAroundPivot on the GUI which works but only once in a GUI, someone suggested a matrix, but i didn’t understand. So instead I am thinking of having more than 1 GUI, is this possible
Thanks
Michael
Your question is strange, what are you calling “GUI”, the method, or the system ?
If it’s the method, you can have infinite onGUI() method at different depth. But everything is managed by one GUI system.
But the RotateAroundPivot dont works only once :o
You can do on onGUI method :
RotateAroundPivot(params)
//stuff
RotateAroundPivot(params)
//other stuff …
etc
Hope it’s help.
hope these two different code will help u…
U can use it for RotateAroundPivot.
Matrix4x4 startMatrix = GUI.matrix;
GUIUtility.ScaleAroundPivot(new Vector2(2f,2f),new Vector2(50,50));
Matrix4x4 startMatrix1 = GUI.matrix;
GUI.Button(new Rect(10,10,200,50),"Scaling1");
GUI.matrix=startMatrix;
GUI.Button(new Rect(10,100,200,50),"not Scaling");
GUI.matrix=startMatrix1;
GUI.Button(new Rect(10,200,200,50),"Scaling2");
GUIUtility.ScaleAroundPivot(new Vector2(2f,2f),new Vector2(50,50));
GUI.Button(new Rect(10,10,200,50),"Scaling");
GUI.Button(new Rect(10,100,200,50),"Scaling");
GUI.Button(new Rect(10,200,200,50),"Scaling");
Ok thanks for the code, it doesn’t look too frightening after all, hope it works for me, will try tonight
As for RotateAroundPivot, this was working for me, but if i had 2 buttons using RotateAroundPivot,the first one would rotate everything after the RoatateAroundPivot including textures,boxes,buttons etc. Then I would try to add the Texture with RotateAroundPivot at the very end, but if i put another
texture with RotateAroundPivot after that, the second last texture would disappear and the last one would work.
The GUI design is within a JavaScript file which is attached to a door that is supposed to rotate in the game and then the texture (door symbol in plan) would also rotate on the GUI
Is it better to have the GUI script in a seperate file to the rotate door script file. If so, how do i call the script with the GUI design in it
Thanks
Hope this is semi clear
sorry i can’t able to understand.