- Home /
resize standalone game window with mouse
How would I go about doing this? I've just set up a code that lets me resize the window with asdw keys, but I'm not exactly sure how to go about resizing the actual corners with the mouse. Here's the code:
private int x=640;
private int y=480;
void Update()
{
Screen.SetResolution(x, y, false);
if (Input.GetKeyDown("d"))
{
x += 50;
}
if (Input.GetKeyDown("a"))
{
x -= 50;
}
if (Input.GetKeyDown("w"))
{
y += 50;
}
if (Input.GetKeyDown("s"))
{
y -= 50;
}
}
Any help would be fantastic, thx!
Answer by Eric5h5 · Dec 30, 2012 at 08:50 AM
Use Unity 4 and check "resizable window" in the player settings.
Thx, nice to know that unity 4 does this. so I guess this means that it's not possible in 3? I bought 3 pro and haven't updated yet. But thank you for the response
Answer by TommyEaves2002 · Oct 27, 2015 at 06:44 PM
Try Using this
if (Input.GetAxis("Mouse ScrollWheel")) { }
It returns a positive value if scrolling up and negative value if scrolling down.
Your answer
Follow this Question
Related Questions
Current Desktop Resolution 1 Answer
How to set arbitrary window size when not in fullscreen? 0 Answers
Game window too small? 0 Answers
iOS status bar 2 Answers