[solved]How to get the size of EditorWindow?

Hello!
Recently I started to write a custom Editor script in C#,and I want to place buttons, that stick to the bottom-right side of the window even on resizing.
My problem is that I don’t know how to get the width and the height of the window.
Any good idea?

1 Like

Use EditorWindow.position to get your window’s Rect, which you can get the width and height of.

void OnGUI () {
	Debug.Log("Window width: " + position.width);
}
19 Likes

Thank you very much, it is exactly what I was looking for! :wink:

3 Likes

thanks

1 Like

thx

1 Like

ty

1 Like

ty very much

tysm

ty!

ya… ty