// Copyright (c) Wojciech Figat. All rights reserved. #pragma once #include "Engine/Core/Config/PlatformSettingsBase.h" #include "Engine/Scripting/ScriptingType.h" #include "Engine/Input/Enums.h" #include "Engine/Core/Math/Vector2.h" /// /// Helper class to access display information. /// API_CLASS(Static, Attributes="DebugCommand") class FLAXENGINE_API Screen { DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screen); /// /// Gets the fullscreen mode. /// /// The value API_PROPERTY() static bool GetIsFullscreen(); /// /// Sets the fullscreen mode. /// /// /// A fullscreen mode switch may not happen immediately. It will be performed before next frame rendering. /// /// The value. API_PROPERTY() static void SetIsFullscreen(bool value); /// /// Gets the window size (in screen-space, includes DPI scale). /// /// The value API_PROPERTY() static Float2 GetSize(); /// /// Converts the screen-space position to the game viewport position. /// /// The screen-space position. /// The game viewport position. API_FUNCTION() static Float2 ScreenToGameViewport(const Float2& screenPos); /// /// Converts the game viewport position to the screen-space position. /// /// The game viewport position. /// The screen-space position. API_FUNCTION() static Float2 GameViewportToScreen(const Float2& viewportPos); /// /// Sets the window size (in screen-space, includes DPI scale). /// /// /// Resizing may not happen immediately. It will be performed before next frame rendering. /// /// The value. API_PROPERTY() static void SetSize(const Float2& value); /// /// Gets the cursor visible flag. /// /// The value. API_PROPERTY() static bool GetCursorVisible(); /// /// Sets the cursor visible flag. /// /// The value. API_PROPERTY() static void SetCursorVisible(const bool value); /// /// Gets the cursor lock mode. /// /// The current cursor lock mode. API_PROPERTY() static CursorLockMode GetCursorLock(); /// /// Sets the cursor lock mode. /// /// The mode. API_PROPERTY() static void SetCursorLock(CursorLockMode mode); /// /// Gets the game window mode. /// /// The current window mode. API_PROPERTY() static GameWindowMode GetGameWindowMode(); /// /// Sets the game window mode. /// /// /// A fullscreen mode switch may not happen immediately. It will be performed before next frame rendering. Will not work in editor. /// /// 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(); };