Package | starling.utils |
Class | public class SystemUtil |
Inheritance | SystemUtil Object |
Property | Defined By | ||
---|---|---|---|
isAIR : Boolean [static] [read-only] Indicates if the code is executed in an Adobe AIR runtime (true)
or Flash plugin/projector (false). | SystemUtil | ||
isAndroid : Boolean [static] [read-only] Indicates if the code is executed on an Android device, based on the
platform string. | SystemUtil | ||
isApplicationActive : Boolean [static] [read-only] Indicates if the application is currently active. | SystemUtil | ||
isDesktop : Boolean [static] [read-only] Indicates if the code is executed on a Desktop computer with Windows, macOS or Linux
operating system. | SystemUtil | ||
isIOS : Boolean [static] [read-only] Indicates if the code is executed on an iOS device, based on the platform
string. | SystemUtil | ||
isMac : Boolean [static] [read-only] Indicates if the code is executed on a Macintosh, based on the platform
string. | SystemUtil | ||
isWindows : Boolean [static] [read-only] Indicates if the code is executed on Windows, based on the platform
string. | SystemUtil | ||
platform : String [static] Returns the three-letter platform string of the current system. | SystemUtil | ||
supportsDepthAndStencil : Boolean [static] [read-only] Returns the value of the 'initialWindow.depthAndStencil' node of the application
descriptor, if this in an AIR app; otherwise always true. | SystemUtil | ||
supportsVideoTexture : Boolean [static] [read-only] Indicates if the current platform and runtime support video textures. | SystemUtil | ||
version : String [static] [read-only] Returns the Flash Player/AIR version string. | SystemUtil |
Method | Defined By | ||
---|---|---|---|
executeWhenApplicationIsActive(call:Function, ... args):void [static] Executes the given function with its arguments the next time the application is active. | SystemUtil | ||
initialize():void [static] Initializes the ACTIVATE/DEACTIVATE event handlers on the native
application. | SystemUtil | ||
isEmbeddedFont(fontName:String, bold:Boolean = false, italic:Boolean = false, fontType:String = embedded):Boolean [static] Figures out if an embedded font with the specified style is available. | SystemUtil | ||
updateEmbeddedFonts():void [static] Updates the list of embedded fonts. | SystemUtil |
isAIR | property |
isAIR:Boolean
[read-only] Indicates if the code is executed in an Adobe AIR runtime (true) or Flash plugin/projector (false).
public static function get isAIR():Boolean
isAndroid | property |
isAndroid:Boolean
[read-only] Indicates if the code is executed on an Android device, based on the
platform
string.
public static function get isAndroid():Boolean
isApplicationActive | property |
isApplicationActive:Boolean
[read-only] Indicates if the application is currently active. On Desktop, this means that it has the focus; on mobile, that it is in the foreground. In the Flash Plugin, always returns true.
public static function get isApplicationActive():Boolean
isDesktop | property |
isDesktop:Boolean
[read-only] Indicates if the code is executed on a Desktop computer with Windows, macOS or Linux operating system. If the method returns 'false', it's probably a mobile device or a Smart TV.
public static function get isDesktop():Boolean
isIOS | property |
isIOS:Boolean
[read-only] Indicates if the code is executed on an iOS device, based on the platform
string.
public static function get isIOS():Boolean
isMac | property |
isMac:Boolean
[read-only] Indicates if the code is executed on a Macintosh, based on the platform
string.
public static function get isMac():Boolean
isWindows | property |
isWindows:Boolean
[read-only] Indicates if the code is executed on Windows, based on the platform
string.
public static function get isWindows():Boolean
platform | property |
platform:String
Returns the three-letter platform string of the current system. These are
the most common platforms: WIN, MAC, LNX, IOS, AND, QNX
. Except for the
last one, which indicates "Blackberry", all should be self-explanatory.
For debugging purposes, you can also assign a custom value.
public static function get platform():String
public static function set platform(value:String):void
supportsDepthAndStencil | property |
supportsDepthAndStencil:Boolean
[read-only] Returns the value of the 'initialWindow.depthAndStencil' node of the application
descriptor, if this in an AIR app; otherwise always true
.
public static function get supportsDepthAndStencil():Boolean
supportsVideoTexture | property |
supportsVideoTexture:Boolean
[read-only] Indicates if the current platform and runtime support video textures.
public static function get supportsVideoTexture():Boolean
version | property |
version:String
[read-only] Returns the Flash Player/AIR version string. The format of the version number is: majorVersion,minorVersion,buildNumber,internalBuildNumber.
public static function get version():String
executeWhenApplicationIsActive | () | method |
public static function executeWhenApplicationIsActive(call:Function, ... args):void
Executes the given function with its arguments the next time the application is active. (If it is active already, the call will be executed right away.)
Parameters
call:Function | |
... args |
initialize | () | method |
public static function initialize():void
Initializes the ACTIVATE/DEACTIVATE
event handlers on the native
application. This method is automatically called by the Starling constructor.
isEmbeddedFont | () | method |
public static function isEmbeddedFont(fontName:String, bold:Boolean = false, italic:Boolean = false, fontType:String = embedded):Boolean
Figures out if an embedded font with the specified style is available. The fonts are enumerated only once; if you load a font at runtime, be sure to call 'updateEmbeddedFonts' before calling this method.
Parameters
fontName:String — the name of the font
| |
bold:Boolean (default = false ) — indicates if the font has a bold style
| |
italic:Boolean (default = false ) — indicates if the font has an italic style
| |
fontType:String (default = embedded ) — the type of the font (one of the constants defined in the FontType class)
|
Boolean |
updateEmbeddedFonts | () | method |
public static function updateEmbeddedFonts():void
Updates the list of embedded fonts. To be called when a font is loaded at runtime.