class Screen
package openfl.display
extends EventDispatcher
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The Screen class provides information about the display screens available to this application.
Screens are independent desktop areas within a possibly larger "virtual desktop." The origin of the virtual desktop is the top-left corner of the operating-system-designated main screen. Thus, the coordinates for the bounds of an individual display screen may be negative. There may also be areas of the virtual desktop that are not within any of the display screens.
The Screen class includes static class members for accessing the available screen objects and instance members for accessing the properties of an individual screen. Screen information should not be cached since it can be changed by a user at any time.
Note that there is not necessarily a one-to-one correspondance between screens and the physical monitors attached to a computer. For example, two monitors may display the same screen.
You cannot instantiate the Screen class directly. Calls to the
new Screen()
constructor throw an ArgumentError exception.
Static variables
Static methods
staticgetScreensForRectangle(rect:Rectangle):Array<Screen>
Returns the (possibly empty) set of screens that intersect the provided rectangle.
Variables
read onlybounds:Rectangle
The bounds of this screen.
The screen location is relative to the virtual desktop.
On Linux systems that use certain window managers, this property returns the desktop bounds, not the screen's visible bounds.
read onlyvisibleBounds:Rectangle
The bounds of the area on this screen in which windows can be visible.
The visibleBounds of a screen excludes the task bar (and other docked desk bars) on Windows, and excludes the menu bar and, depending on system settings, the dock on Mac OS X. On some Linux configurations, it is not possible to determine the visible bounds.
In these cases, the visibleBounds property returns the same value as the screenBounds property.