diff --git a/Source/Engine/Engine/Screen.cpp b/Source/Engine/Engine/Screen.cpp
index 2bc6e1f58..fc7e8a022 100644
--- a/Source/Engine/Engine/Screen.cpp
+++ b/Source/Engine/Engine/Screen.cpp
@@ -181,6 +181,11 @@ void Screen::SetGameWindowMode(GameWindowMode windowMode)
#endif
}
+Window* Screen::GetMainWindow()
+{
+ return Engine::MainWindow;
+}
+
void ScreenService::Update()
{
#if USE_EDITOR
diff --git a/Source/Engine/Engine/Screen.h b/Source/Engine/Engine/Screen.h
index 42be20a38..b7bd89c38 100644
--- a/Source/Engine/Engine/Screen.h
+++ b/Source/Engine/Engine/Screen.h
@@ -96,4 +96,10 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screen);
///
/// The window mode.
API_PROPERTY() static void SetGameWindowMode(GameWindowMode windowMode);
+
+ ///
+ /// Gets the main window.
+ ///
+ /// The current window. Will be null if fails.
+ API_PROPERTY() static Window* GetMainWindow();
};