- Home /
C# How to Drag and Scale with Mouse Window
I'm trying to make the example in the Unity 3d documentation drag and scale with the mouse.But I can't find anything in the documentation for GUI.Window that mentions how to do that. Do you guys know how?
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour {
public Rect windowRect = new Rect(20, 20, 120, 50);
void OnGUI() {
//Trying to make GUI.Window move and scale
windowRect = GUI.Window(0, windowRect, DoMyWindow, "My Window");
}
void DoMyWindow(int windowID) {
if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World"))
print("Got a click");
}
}
Comment
Your answer
Follow this Question
Related Questions
C# Applying Transparency to a Single GUI.Button 1 Answer
C# Boolean Doesn't Change Value 1 Answer
What is frame, How OnGuI is called every frame? 2 Answers
C# GUI Destroy or Disable? 1 Answer
FPS keep a loadout 0 Answers