- Home /
GUI.ModalWindow invisible on iOS device with retina display
Code that is perfectly working in the game mode is not fully working on my iOS device. The modal window seems to be active, as interaction with other elements is not possible anymore. The window function is called, I checked this with a debug statement. But the window is not shown.
private GUI.WindowFunction currentWindowFunction;
private Rect currentWindowRect;
private int currentWindowId;
private bool shouldRenderPopup;
private string currentWindowTitle;
private float fade;
//...
void OnGUI ()
// ...
bool toSettingsButtonPressed = GUI.Button (new Rect (900, 600, 44, 44), settingsButtonTex);
if (toSettingsButtonPressed) {
currentWindowFunction = SettingsWindow;
currentWindowRect = settingsWindowRect;
currentWindowId = settingsWindowId;
currentWindowTitle = "Einstellungen";
shouldRenderPopup = true;
fade = 0;
}
Debug.Log("modal " + GUIUtility.hasModalWindow);
if (shouldRenderPopup) {
fade = Mathf.Clamp (fade += 0.01f, 0f, 1f);
GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, fade);
settingsWindowRect = GUI.ModalWindow(currentWindowId, currentWindowRect, currentWindowFunction, currentWindowTitle);
}
// ...
Answer by fschneider · Jul 04, 2014 at 02:11 PM
Ouch.. my window has been off screen.
I was using: Rect settingsWindowRect = new Rect (Screen.width / 2, Screen.height / 2, Screen.width - (Screen.width / 8),Screen.height - (Screen.height / 8));
This will work in the unity game window. But on my iPad with Retina display it does not show up. On the iPad 2 (non-retina) it shows up with the upper left corner in the center of the screen.
Your answer
![](https://koobas.hobune.stream/wayback/20220613153248im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
NullReferenceException: Object reference not set to an instance of an object 0 Answers
Blank/Black Screen appearing before video loading in unity ios pro? 0 Answers
Font size different on iPhone? 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
iOS iAD Problem Rejection 0 Answers