Hello everyone
I have this script of gui.matrix and it works great but its for c++ and i did my whole project in java and i cant just change it so i ask if someone knows how to translate the script i really tried everything but it just doesnt do anything
Script:
Matrix4x4 transformation = Matrix4x4.TRS(
Vector3.zero,
Quaternion.identity,
Vector3.one);
void OnGUI() {
// We need to assign the GUI matrix before GUI controls are shown.
GUI.matrix = transformation;
if (GUI.Button(new Rect((Screen.width - 250) / 2, (Screen.height - 100) / 2 - 55, 250, 100), "TRANSFORM GUI")) {
transformation = Matrix4x4.TRS(
new Vector3(-Screen.width * 0.2f, -Screen.height * 0.7f, 0), // move the GUI a little to fit the transformed controls in the screen
Quaternion.Euler(0, 0, 15), // rotate 15 degrees clockwise around Z, because controls are in XY plane
new Vector3(2, 2, 1)); // scale GUI x2 times in X and Y
}
if (GUI.Button(new Rect((Screen.width - 250) / 2, (Screen.height - 100) / 2 + 55, 250, 100), "NORMALIZE GUI")) {
transformation = Matrix4x4.TRS(
Vector3.zero,
Quaternion.identity,
Vector3.one);
}
}
script made by unimechanic
Thanks in advance Skullbeats1