- Home /
Why is Screen.width and Screen.height wrong for scene view?
When in OnSceneGUI related callbacks, Screen.width is 3 pixels too big and Screen.height is 38...
For example if the actual width of the scene view is 700 pixels, Screen.width says 703. And if scene view height were 700 pixels, Screen.height would return 738
WHYYYYYYYYYYYYYYYYYYYYYYYYY?
Answer by michaelday008 · Feb 27 at 09:21 AM
I know this question is seven years old now, but in case anyone else got stumped on this like I did, the screen height is returning with the menu and toolbars at the top added for some reason. To get the actual viewable areas, you can use
andSceneView.currentDrawingSceneView.camera.pixelWidth
SceneView.currentDrawingSceneView.camera.pixelHeight
Your answer

Follow this Question
Related Questions
full screen wide GUI.Box 3 Answers
Thin Line on top of GUI 0 Answers
How can I make my game's art pixel perfect with a 2:1 pixel ratio? 0 Answers
can I scale up screen pixels? 1 Answer
Problem in working with pixel . 1 Answer